bug-coreutils
[Top][All Lists]
Advanced

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

bug#29788: chown: recursive operation with "-H" flag does not work as do


From: Bernhard Voelker
Subject: bug#29788: chown: recursive operation with "-H" flag does not work as documented
Date: Thu, 21 Dec 2017 00:07:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]