Eric Andersen | 9f0fedb | 2001-04-24 18:07:19 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
Eric Andersen | bdfd0d7 | 2001-10-24 05:00:29 +0000 | [diff] [blame] | 3 | * Mini chgrp implementation for busybox |
Eric Andersen | 9f0fedb | 2001-04-24 18:07:19 +0000 | [diff] [blame] | 4 | * |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 5 | * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> |
Eric Andersen | 9f0fedb | 2001-04-24 18:07:19 +0000 | [diff] [blame] | 6 | * |
Bernhard Reutner-Fischer | b1629b1 | 2006-05-19 19:29:19 +0000 | [diff] [blame] | 7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
Eric Andersen | 9f0fedb | 2001-04-24 18:07:19 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
Denis Vlasenko | e80e2a3 | 2006-10-27 23:28:38 +0000 | [diff] [blame^] | 10 | /* BB_AUDIT SUSv3 defects - unsupported options -H, -L, and -P. */ |
| 11 | /* BB_AUDIT GNU defects - unsupported long options. */ |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 12 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/chgrp.html */ |
| 13 | |
Eric Andersen | 9f0fedb | 2001-04-24 18:07:19 +0000 | [diff] [blame] | 14 | #include "busybox.h" |
Eric Andersen | 9f0fedb | 2001-04-24 18:07:19 +0000 | [diff] [blame] | 15 | |
Eric Andersen | 9f0fedb | 2001-04-24 18:07:19 +0000 | [diff] [blame] | 16 | int chgrp_main(int argc, char **argv) |
| 17 | { |
Denis Vlasenko | e80e2a3 | 2006-10-27 23:28:38 +0000 | [diff] [blame^] | 18 | /* "chgrp [opts] abc file(s)" == "chown [opts] :abc file(s)" */ |
| 19 | char **p = argv; |
| 20 | while (*++p) { |
| 21 | if (p[0][0] != '-') { |
| 22 | p[0] = xasprintf(":%s", p[0]); |
| 23 | break; |
Eric Andersen | 9f0fedb | 2001-04-24 18:07:19 +0000 | [diff] [blame] | 24 | } |
Denis Vlasenko | e80e2a3 | 2006-10-27 23:28:38 +0000 | [diff] [blame^] | 25 | } |
| 26 | return chown_main(argc, argv); |
Eric Andersen | 9f0fedb | 2001-04-24 18:07:19 +0000 | [diff] [blame] | 27 | } |