GNU bug report logs - #29788
chown: recursive operation with "-H" flag does not work as documented

Previous Next

Package: coreutils;

Reported by: Michael Orlitzky <michael <at> orlitzky.com>

Date: Wed, 20 Dec 2017 18:31:01 UTC

Severity: normal

Tags: notabug

Done: Bernhard Voelker <mail <at> bernhard-voelker.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Orlitzky <michael <at> orlitzky.com>
To: 29788 <at> debbugs.gnu.org
Subject: bug#29788: chown: recursive operation with "-H" flag does not work as documented
Date: Wed, 20 Dec 2017 13:24:14 -0500
The documentation for the "-H" flag to chown says,

  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

This is not doing what I think it should do. In a terminal, as my "mjo"
system user, I can run,

  $ mkdir foo
  $ mkdir bar
  $ ln -s ../bar foo/baz
  $ sudo chown --verbose --recursive -H root foo

which outputs...

  changed ownership of 'foo/baz' from mjo to root
  changed ownership of 'foo' from mjo to root

However, the path "foo/baz" was not passed on the command-line, and
chown did in fact follow the symlink,

  $ ls -l | grep bar
  drwxr-xr-x  2 root mjo 4.0K 2017-12-20 13:19 bar

as evidenced by the fact that "bar" was created as mjo:mjo.




This bug report was last modified 7 years and 154 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.