summaryrefslogtreecommitdiff
path: root/src/chgrp.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-12-14 15:41:05 +0100
committerJim Meyering <jim@meyering.net>2006-12-14 15:41:50 +0100
commitc3154b2947abbb8d03a412d5874fcceb1fc29393 (patch)
tree228cca8b905de2e2542887e211fec68bb2a298ba /src/chgrp.c
parent24852bf5b5e7fd954f2e4d1d08d58575453b48b0 (diff)
downloadcoreutils-c3154b2947abbb8d03a412d5874fcceb1fc29393.tar.xz
chgrp, chown: Don't prohibit -RLh, aka -RL with --no-dereference.
* src/chgrp.c (main): Don't prohibit -RLh, aka -RL with --no-dereference. * src/chown.c (main): Likewise. * src/chown-core.c (change_file_owner): Add to a comment. * tests/chown/preserve-root: Add tests. * doc/coreutils.texi (Treating / specially): With --preserve-root, chgrp and chown will not modify "/", even through a symlink.
Diffstat (limited to 'src/chgrp.c')
-rw-r--r--src/chgrp.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/chgrp.c b/src/chgrp.c
index 7e96b4c36..faf58d36b 100644
--- a/src/chgrp.c
+++ b/src/chgrp.c
@@ -260,20 +260,14 @@ main (int argc, char **argv)
if (dereference == 1)
error (EXIT_FAILURE, 0,
_("-R --dereference requires either -H or -L"));
- chopt.affect_symlink_referent = false;
- }
- else
- {
- if (dereference == 0)
- error (EXIT_FAILURE, 0, _("-R -h requires -P"));
- chopt.affect_symlink_referent = true;
+ dereference = 0;
}
}
else
{
bit_flags = FTS_PHYSICAL;
- chopt.affect_symlink_referent = (dereference != 0);
}
+ chopt.affect_symlink_referent = (dereference != 0);
if (argc - optind < (reference_file ? 1 : 2))
{