Paul Eggert <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> > > 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? _______________________________________________ Bug-coreutils mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/bug-coreutils
