aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/chflags/chflags.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2001-05-28 12:58:10 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2001-05-28 12:58:10 +0000
commit8e46d9c279acd0d14e77b6cc3b05e2fdcc45e8b6 (patch)
treef56a2ae90365d34273511170c8dc9d698ca4f7ce /usr.bin/chflags/chflags.c
parenta89ab9bbe40d5ca5d6f0ed87d63eb0960c8009f0 (diff)
downloadsrc-8e46d9c279acd0d14e77b6cc3b05e2fdcc45e8b6.tar.gz
src-8e46d9c279acd0d14e77b6cc3b05e2fdcc45e8b6.zip
Follow symbolic links named as command line arguments if run without -R.
This is required by symlink(7), ``Commands not traversing a file tree'' subsection, third paragraph: : It is important to realize that this rule includes commands which may : optionally traverse file trees, e.g. the command ``chown file'' is : included in this rule, while the command ``chown -R file'' is not. For chown(8) and chgrp(1), this is also is compliance with the latest POSIX 1003.1-200x draft. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=77333
Diffstat (limited to 'usr.bin/chflags/chflags.c')
-rw-r--r--usr.bin/chflags/chflags.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/chflags/chflags.c b/usr.bin/chflags/chflags.c
index 40c5b3f432b8..f46baa0efaeb 100644
--- a/usr.bin/chflags/chflags.c
+++ b/usr.bin/chflags/chflags.c
@@ -99,15 +99,16 @@ main(argc, argv)
if (argc < 2)
usage();
- fts_options = FTS_PHYSICAL;
if (Rflag) {
+ fts_options = FTS_PHYSICAL;
if (Hflag)
fts_options |= FTS_COMFOLLOW;
if (Lflag) {
fts_options &= ~FTS_PHYSICAL;
fts_options |= FTS_LOGICAL;
}
- }
+ } else
+ fts_options = FTS_LOGICAL;
flags = *argv;
if (*flags >= '0' && *flags <= '7') {