[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#554893: startup script should be more careful with chown -R

On Sun, Nov 08, 2009 at 09:21:14PM +0300, Michael Tokarev wrote:
> A good one. It appears that I quite something changed since I last looked
> at this. No, I didn't test it because I remember it's how things worked
> before. But that was long before.... ;)
> As of coreutils-6.0, coreutils supports *at syscalls (incl. fchownat),
> and always specifying AT_SYMLINK_NOFOLLOW. My system eve had strace that
> does not understand these!.. ;)
> See the NEWS file in coreutils package. In particular, this:
> -----------
> * Major changes in release 5.3.0 (2005-01-08) [unstable]

Well, chown's link-following behavior seems to also potentially
differ between normal and -R modes. At least as far back as:

   coreutils (5.2.1-1)
   chgrp and chown now accept POSIX-mandated -L, -H, and -P options
   Wed, 14 Jul 2004 06:13:38 -0400

Browsing around a Debian sarge/3.1 system I still have on hand (with
coreutils 5.2.1-2 installed), the chown manpage states:

   The following options modify how a hierarchy is traversed when
   the -R option is also specified. If more than one is specified,
   only the final one takes effect.

   -H     if a command line argument is a symbolic link to a
          directory, traverse it

   -L     traverse every symbolic link to a directory encountered

   -P     do not traverse any symbolic links (default)

I don't think I have any woody/3.0 servers left around, so I can't
easily test back any farther than that, but I retested and confirmed
sarge/3.1 chown from coreutils doesn't follow symbolic links by
default any more than on present-day sid (repeated the same tests).
I don't doubt that at some time in the past chown probably did
follow by default, but even though I've been a GNU/Linux user since
'92 my personal memory doesn't seem to go back nearly that far... ;)
{ IRL(Jeremy_Stanley); PGP(9E8DFF2E4F5995F8FEADDC5829ABF7441FB84657);
SMTP(fungi@yuggoth.org); IRC(fungi@irc.yuggoth.org#ccl); ICQ(114362511);
AIM(dreadazathoth); YAHOO(crawlingchaoslabs); FINGER(fungi@yuggoth.org);
MUD(fungi@katarsis.mudpy.org:6669); WWW(http://fungi.yuggoth.org/); }

Reply to: