diff options
author | bde <bde@FreeBSD.org> | 1998-05-03 04:17:48 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-05-03 04:17:48 +0000 |
commit | 1aa46dab330226a688195701a188c405f0d46123 (patch) | |
tree | 6483b14d203c9f5bb67b77fd6a099af426e04d07 /usr.sbin/chown | |
parent | 3a554077f346a98829f19f38b01f9b71b2079d37 (diff) | |
download | FreeBSD-src-1aa46dab330226a688195701a188c405f0d46123.zip FreeBSD-src-1aa46dab330226a688195701a188c405f0d46123.tar.gz |
Backed out previous commit. chown(8) doesn't follow symlinks by
default, at least in BSD. This used to be automatic, because chown(2)
didn't follow symlinks. When chown(2) was changed to follow symlinks
in BSD4.4, chown(8) was changed to not follow symlinks by default.
The previous commit broke this. The first victim was bsd.prog.mk,
which uses a plain chown in an attempt to change the ownership of the
symlinks to `dm' in /usr/games. This fails when it is done before
dm is installed, or messes up the ownership of dm if dm is installed.
Unfixed problems:
1. When lchown(2) was implemented, chown(8) wasn't changed to implement
the historical behaviour of changing ownership of symlinks. I'm not
sure if it should have been. The -HLP options give more complete
control, but they unfortunately don't apply unless the -R option is
specified (a problem shared with other commands, e.g., cp; I guess
we're supposed to use -R even for non-recursive traversals).
2. If we implement the historical behaviour, then -h would become a no-op
and should be left undocumented.
3. The man page suggests that without option -h, all symlinks (to files
specified in the command line?) are followed. It's not clear what
"the file" is. These bugs were introduced when -h was documented.
4. The correct interaction of -h with the other flags is not clear.
Diffstat (limited to 'usr.sbin/chown')
-rw-r--r-- | usr.sbin/chown/chown.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/chown/chown.c b/usr.sbin/chown/chown.c index 8eb75f7..71dafb9 100644 --- a/usr.sbin/chown/chown.c +++ b/usr.sbin/chown/chown.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)chown.c 8.8 (Berkeley) 4/4/94"; #else static const char rcsid[] = - "$Id: chown.c,v 1.10 1998/03/09 08:54:31 jkh Exp $"; + "$Id: chown.c,v 1.11 1998/05/02 12:57:57 helbig Exp $"; #endif #endif /* not lint */ @@ -165,6 +165,7 @@ main(argc, argv) warnx("%s: %s", p->fts_path, strerror(p->fts_errno)); rval = 1; continue; + case FTS_SL: /* Ignore. */ case FTS_SLNONE: /* * The only symlinks that end up here are ones that |