Subject: Re: bug#11108: [PATCH] chmod: fix symlink race condition

From: Jim Meyering <[email-masked]>
Date: Wed, 28 Mar 2012 22:13:12 +0200

Paul Eggert wrote:
> On 03/28/2012 12:36 AM, Jim Meyering wrote:
>> I presume you'll update NEWS, too, where you can say
>> [bug introduced in the beginning]
>
> Thanks, good point.  I did that in the version I just committed
> to the master.

Rats:

    $ ./chmod u+w f
    ./chmod: changing permissions of 'f': Operation not supported

That fix introduces chmod failures on several important systems,
including my Fedora 17 desktop ;-)

I confess that I had not tested it, and had missed or forgotten
this part of the GNU/Linux/fchmodat documentation:

       AT_SYMLINK_NOFOLLOW
              If pathname is a symbolic link, do not dereference  it:  instead
              operate  on  the link itself.  This flag is not currently imple-
              mented.

The nixos/hydra build server is reporting failures, too:

  http://hydra.nixos.org/build/2341393
  http://hydra.nixos.org/build/2341397
  http://hydra.nixos.org/build/2341395