diff options
author | Liu, Shuang (ADITG/ESM) <sliu@de.adit-jv.com> | 2019-11-13 14:36:20 +0000 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-11-17 17:06:31 +0100 |
commit | af6bc54fdefabae9ca433e515f7f1aa050184c9a (patch) | |
tree | 168514f97be1bf8be95c5b88add2868056944ddd | |
parent | b230fdfa9da2f31e6cc90f90579c6d020c770f86 (diff) | |
download | busybox-w32-af6bc54fdefabae9ca433e515f7f1aa050184c9a.tar.gz busybox-w32-af6bc54fdefabae9ca433e515f7f1aa050184c9a.tar.bz2 busybox-w32-af6bc54fdefabae9ca433e515f7f1aa050184c9a.zip |
chgrp: correct the usage for non-desktop chgrp calls
When IF_DESKTOP is not defined, chown and chgrp only takes option -R -h,
However the usage output of chgrp is wrong:
$ ./busybox.nosuid chown
Usage: chown [-Rh]... USER[:[GRP]] FILE...
$ ./busybox.nosuid chgrp
Usage: chgrp [-RhLHP]... GROUP FILE...
$ ./busybox.nosuid chgrp -H group dummy
chgrp: invalid option -- 'H'
Usage: chgrp [-RhLHP]... GROUP FILE...
The chgrp is now a wrapper of chown, so the recognized options shall be the same.
This is introduced by 34425389e09353a8dacdd6b23a62553f699c544c
I would expect the correct behavior shall be the same as chown.
So suggest the below patch, the behavior shall be:
$ ./busybox.nosuid chgrp
Usage: chgrp [-Rh]... GROUP FILE...
Signed-off-by: Shuang Liu <sliu@de.adit-jv.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | coreutils/chgrp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/chgrp.c b/coreutils/chgrp.c index ae216aa3f..4da43c45e 100644 --- a/coreutils/chgrp.c +++ b/coreutils/chgrp.c | |||
@@ -21,15 +21,15 @@ | |||
21 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/chgrp.html */ | 21 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/chgrp.html */ |
22 | 22 | ||
23 | //usage:#define chgrp_trivial_usage | 23 | //usage:#define chgrp_trivial_usage |
24 | //usage: "[-RhLHP"IF_DESKTOP("cvf")"]... GROUP FILE..." | 24 | //usage: "[-Rh"IF_DESKTOP("LHPcvf")"]... GROUP FILE..." |
25 | //usage:#define chgrp_full_usage "\n\n" | 25 | //usage:#define chgrp_full_usage "\n\n" |
26 | //usage: "Change the group membership of each FILE to GROUP\n" | 26 | //usage: "Change the group membership of each FILE to GROUP\n" |
27 | //usage: "\n -R Recurse" | 27 | //usage: "\n -R Recurse" |
28 | //usage: "\n -h Affect symlinks instead of symlink targets" | 28 | //usage: "\n -h Affect symlinks instead of symlink targets" |
29 | //usage: IF_DESKTOP( | ||
29 | //usage: "\n -L Traverse all symlinks to directories" | 30 | //usage: "\n -L Traverse all symlinks to directories" |
30 | //usage: "\n -H Traverse symlinks on command line only" | 31 | //usage: "\n -H Traverse symlinks on command line only" |
31 | //usage: "\n -P Don't traverse symlinks (default)" | 32 | //usage: "\n -P Don't traverse symlinks (default)" |
32 | //usage: IF_DESKTOP( | ||
33 | //usage: "\n -c List changed files" | 33 | //usage: "\n -c List changed files" |
34 | //usage: "\n -v Verbose" | 34 | //usage: "\n -v Verbose" |
35 | //usage: "\n -f Hide errors" | 35 | //usage: "\n -f Hide errors" |