bug-coreutils
[Top][All Lists]
Advanced

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

Re: Bug#249177: coreutils: chown is not POSIXLY_CORRECT even when the va


From: Jim Meyering
Subject: Re: Bug#249177: coreutils: chown is not POSIXLY_CORRECT even when the variable is set
Date: Tue, 08 Jun 2004 18:54:30 +0200

Paul Eggert <address@hidden> wrote:
> I looked at POSIX and found some other incompatibilities with
> coreutils chown and chgrp.  Here's a proposed patch to fix everything
> I found.  When in doubt I did what BSD does.  Sorry about the size,
> but there do seem to be a lotta gotchas in this area.
>
> 2004-05-18  Paul Eggert  <address@hidden>
>
>       Several fixes to chgrp and chown for compatibility with POSIX and BSD:
>
>         Check for incompatible options.  When -R and --dereference are
>         both used, then either -H or -L must also be used.  When -R and -h
>         are both used, then -P must be in effect.
>
>         -H, -L, and -P have no effect unless -R is also specified.
>         If -P and -R are both specified, -h is assumed.
>
>         Do not optimize away the chown() system call when the file's owner
>         and group already have the desired value.  This optimization was
>         incorrect, as it failed to updated the last-changed time and reset
>         special permission bits, as POSIX requires.
>
>         Do not report an error if the owner or group of a
>         recursively-encountered symbolic link cannot be updated because
>         the file system does not support it.
>
>       * NEWS: Document the above.
...

Thanks a lot!  I've applied that.
I especially like the part that does away with the unnecessary
stat/lstat calls.

However, this change makes it so that chown's and chgrp's --changes (-c)
option always reports a change, even when the desired owner and/or group
match those of the file in question.  Shouldn't we should either deprecate
and undocument that option or make it work once again?




reply via email to

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