diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-04-19 02:09:06 +0400 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-04-19 02:09:06 +0400 |
commit | 632bb571357c4cef455c00fb06493810284e544d (patch) | |
tree | 21e52f13437307a0ca182125f6dc11715e16f8c4 /chmod_chown_chgrp.c | |
parent | c366050a23630f0763159263d62b3f1efa0c46ef (diff) |
Fix symlink following bug in chmod -R and friends. Allow SYSV style
'chown foo:bar' in addition to 'chown foo.bar', and fix a bug in the
busybox globbing routine such that 'find /dir -name [i]' no longer
segfaults.
-Erik
Diffstat (limited to 'chmod_chown_chgrp.c')
-rw-r--r-- | chmod_chown_chgrp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/chmod_chown_chgrp.c b/chmod_chown_chgrp.c index 8dd767054..fb93f3ff8 100644 --- a/chmod_chown_chgrp.c +++ b/chmod_chown_chgrp.c @@ -48,7 +48,7 @@ static const char chgrp_usage[] = "chgrp [OPTION]... GROUP FILE...\n\n" "\nOptions:\n\t-R\tchange files and directories recursively\n"; static const char chown_usage[] = - "chown [OPTION]... OWNER[.[GROUP] FILE...\n\n" + "chown [OPTION]... OWNER[<.|:>[GROUP] FILE...\n\n" "Change the owner and/or group of each FILE to OWNER and/or GROUP.\n" "\nOptions:\n\t-R\tchange files and directories recursively\n"; @@ -140,6 +140,8 @@ int chmod_chown_chgrp_main(int argc, char **argv) goto bad_group; } else { groupName = strchr(*argv, '.'); + if (groupName == NULL) + groupName = strchr(*argv, ':'); if (groupName) { *groupName++ = '\0'; gid = strtoul(groupName, &p, 10); @@ -169,7 +171,7 @@ int chmod_chown_chgrp_main(int argc, char **argv) fatalError( "%s: too few arguments\n", invocationName); } while (argc-- > 1) { - if (recursiveAction (*(++argv), recursiveFlag, TRUE, FALSE, + if (recursiveAction (*(++argv), recursiveFlag, FALSE, FALSE, fileAction, fileAction, NULL) == FALSE) exit(FALSE); } |