2001-04-24 18:07:19 +00:00
|
|
|
/* vi: set sw=4 ts=4: */
|
|
|
|
/*
|
2001-10-24 05:00:29 +00:00
|
|
|
* Mini chgrp implementation for busybox
|
2001-04-24 18:07:19 +00:00
|
|
|
*
|
2004-03-15 08:29:22 +00:00
|
|
|
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
|
2001-04-24 18:07:19 +00:00
|
|
|
*
|
2006-05-19 19:29:19 +00:00
|
|
|
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
2001-04-24 18:07:19 +00:00
|
|
|
*/
|
|
|
|
|
2007-03-09 10:08:53 +00:00
|
|
|
/* BB_AUDIT SUSv3 defects - none? */
|
2006-10-27 23:28:38 +00:00
|
|
|
/* BB_AUDIT GNU defects - unsupported long options. */
|
2003-03-19 09:13:01 +00:00
|
|
|
/* http://www.opengroup.org/onlinepubs/007904975/utilities/chgrp.html */
|
|
|
|
|
2001-04-24 18:07:19 +00:00
|
|
|
#include "busybox.h"
|
|
|
|
|
2007-04-10 15:43:37 +00:00
|
|
|
/* This is a NOEXEC applet. Be very careful! */
|
|
|
|
|
|
|
|
|
2007-02-03 17:28:39 +00:00
|
|
|
int chgrp_main(int argc, char **argv);
|
2001-04-24 18:07:19 +00:00
|
|
|
int chgrp_main(int argc, char **argv)
|
|
|
|
{
|
2006-10-27 23:28:38 +00:00
|
|
|
/* "chgrp [opts] abc file(s)" == "chown [opts] :abc file(s)" */
|
|
|
|
char **p = argv;
|
|
|
|
while (*++p) {
|
|
|
|
if (p[0][0] != '-') {
|
|
|
|
p[0] = xasprintf(":%s", p[0]);
|
|
|
|
break;
|
2001-04-24 18:07:19 +00:00
|
|
|
}
|
2006-10-27 23:28:38 +00:00
|
|
|
}
|
|
|
|
return chown_main(argc, argv);
|
2001-04-24 18:07:19 +00:00
|
|
|
}
|