Subject: Re: Bug#497514: coreutils: chmod, chown, and chgrp change ctime even when no change was necessary

From: Eric Blake <[email-masked]>
Date: Thu, 11 Sep 2008 21:20:21 -0600

According to Paul Eggert on 9/11/2008 11:56 AM:
> 
> As I read the spec, chown and chgrp are explicitly required to make
> the equivalent of a chown() call, which in turn is required to change
> the ctime.  However, chmod is not required to make the equivalent of a
> chmod() call, and there is no requirement in the 'chmod' spec that it
> change the ctime.  So POSIX allows the optimization for the 'chmod'
> command, but not for the 'chown' and 'chgrp' commands.

On the other hand, the POSIX spec for chmod(1) mentions that it is
implementation defined on how it affects alternate access control.  I have
come to expect on many systems that support ACLs, that 'chmod 755' on a
file with rwxr-xr-x+ permissions will remove the ACLs.  In other words,
optimizing away the chmod(2) call because it compares equal to the stat
information would break this side-effect of clearing ACLs.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [email-masked]