From cce38586aee7fe892ca1c837ee08a96bd3454ee9 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Mon, 26 Feb 2007 22:47:42 +0000 Subject: start_stop_daemon: add -chuid support --- coreutils/chown.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'coreutils') diff --git a/coreutils/chown.c b/coreutils/chown.c index dad5ce063..3380677bc 100644 --- a/coreutils/chown.c +++ b/coreutils/chown.c @@ -56,7 +56,6 @@ static int fileAction(const char *fileName, struct stat *statbuf, int chown_main(int argc, char **argv); int chown_main(int argc, char **argv) { - char *groupName; int retval = EXIT_SUCCESS; opt_complementary = "-2"; @@ -65,24 +64,7 @@ int chown_main(int argc, char **argv) if (OPT_NODEREF) chown_func = lchown; - /* First, check if there is a group name here */ - groupName = strchr(*argv, '.'); /* deprecated? */ - if (!groupName) - groupName = strchr(*argv, ':'); - else - *groupName = ':'; /* replace '.' with ':' */ - - /* First, try parsing "user[:[group]]" */ - if (!groupName) { /* "user" */ - ugid.uid = get_ug_id(*argv, xuname2uid); - } else if (groupName == *argv) { /* ":group" */ - ugid.gid = get_ug_id(groupName + 1, xgroup2gid); - } else { - if (!groupName[1]) /* "user:" */ - *groupName = '\0'; - if (!get_uidgid(&ugid, *argv, 1)) - bb_error_msg_and_die("unknown user/group %s", *argv); - } + parse_chown_usergroup_or_die(&ugid, argv[0]); /* Ok, ready to do the deed now */ argv++; -- cgit v1.2.3