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: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Paul Eggert <eggert <at> cs.ucla.edu>, 29788 <at> debbugs.gnu.org, michael <at> orlitzky.com
Subject: bug#29788: chown: recursive operation with "-H" flag does not work as documented
Date: Thu, 21 Dec 2017 00:07:46 +0100
On 12/20/2017 10:52 PM, Paul Eggert wrote:
> For chown -H -R, POSIX
> says that if "a symbolic link referencing a file of type directory is
> specified on the command line,/chown/  shall change the user ID (and
> group ID, if specified) of the directory referenced by the symbolic link
> and all files in the file hierarchy below it." The clear implication in
> context is that -H should mean --dereference at the top level, [...]

I agree here.

> [...] and --no-dereference at lower levels.

I read this different: --dereference is still the default in the
OPs example 'chown -vRH root foo' as -h|--no-dereference was not
explicitly passed.

After all, I somehow have the feeling that the problem is two-fold:
a) The ownership of which file is changed? The symlink or the target?
b) Shall chown follow the symlink or not?
Without a dedicated --follow|--no-follow, it will be impossible to
satisfy all combinations of expected behavior.

Anyway, it seems hard to choose the right combination without knowing
if the command line argument is a symbolic link (and points to a valid
and accessible directory or not) or another file type.

Have a nice day,
Berny




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

Previous Next


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