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

2008-09-13 Thread Jim Meyering
Michael Stone <[EMAIL PROTECTED]> wrote: > On Fri, Sep 12, 2008 at 09:51:04PM +0200, Jim Meyering wrote: >>That sounds like a good reason to retain the behavior you've come to >>value, even if it's not guaranteed or portable, but only via a new >>option. Then we can still change the default to be

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

2008-09-12 Thread Michael Stone
On Fri, Sep 12, 2008 at 09:51:04PM +0200, Jim Meyering wrote: That sounds like a good reason to retain the behavior you've come to value, even if it's not guaranteed or portable, but only via a new option. Then we can still change the default to be more efficient. Why on earth would we want to

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

2008-09-12 Thread Jim Meyering
Eric Blake <[EMAIL PROTECTED]> wrote: > 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 equiva

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

2008-09-11 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 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 eq

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

2008-09-11 Thread Paul Eggert
Erik Rossen <[EMAIL PROTECTED]> writes: > And, if one wants to be REALLY pedantic, it looks like the file node is > supposed to be changed each time. For example, here is an extract: As I read the spec, chown and chgrp are explicitly required to make the equivalent of a chown() call, which in tu

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

2008-09-03 Thread Erik Rossen
I asked the people on the mailing list of our local LUG to test if chmod changes ctime on non-GNU systems even when there is no difference beteen the mode before and after the chmod. From these few data, the trend seems to be that ctime gets changed. Here are the results thus far (identified by "

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

2008-09-02 Thread Erik Rossen
On Tue, Sep 02, 2008 at 02:30:20PM -0600, Bob Proulx wrote: > Erik Rossen wrote: > > As far as speed is concerned, you are right that an extra stat() would > > usually not improve matters. (Would it be an enormous penalty? I doubt > > it.) But users of file integrity checking systems like myself

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

2008-09-02 Thread Bob Proulx
Erik Rossen wrote: > Jim Meyering wrote: > > For chgrp (probably chown, too, at least in some cases), it's not > > as obvious, since the current implementation does not stat files > > before changing permissions. So, to do what you want would involve > > adding a stat call per file to get owner/gr

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

2008-09-02 Thread Erik Rossen
On Tue, Sep 02, 2008 at 08:06:51PM +0200, Jim Meyering wrote: > Good idea. > At least for chmod, it is not only possible, but the optimization > would be essentially free, since chmod already has the required stat data. Yeah, I thought it was a good idea too. > AFAICS POSIX > (http://www.opengrou

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

2008-09-02 Thread Jim Meyering
Erik Rossen <[EMAIL PROTECTED]> wrote: > On Tue, Sep 02, 2008 at 08:19:38AM -0400, Michael Stone wrote: >> On Tue, Sep 02, 2008 at 11:30:46AM +0200, you wrote: >> >It would be nice if chmod (and chown and chgrp) only made changes to >> >inodes when necessary so as not to change the ctime of files.