GNU bug report logs - #22185
Operation not permitted for `touch -d` on 777 file

Previous Next

Package: coreutils;

Reported by: Silvio Ricardo Cordeiro <silvioricardoc <at> gmail.com>

Date: Wed, 16 Dec 2015 16:42:01 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 22185 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: Silvio Ricardo Cordeiro <silvioricardoc <at> gmail.com>, 22185 <at> debbugs.gnu.org
Subject: Re: bug#22185: Operation not permitted for `touch -d` on 777 file
Date: Wed, 16 Dec 2015 13:27:50 -0500
tag 22185 notabug
close 22185
stop

Additional information:

On 12/16/2015 01:19 PM, Assaf Gordon wrote:
> Hello,
>
> On 12/16/2015 09:39 AM, Silvio Ricardo Cordeiro wrote:
>> The following code fails whenever the specified date is different from `now`:

<...>
>>
>> I see no description of that in the documentation, and it just seems wrong. If other users have full control over the file (and surrounding directory), shouldn't they be able to change its date?

<...>

> If the above is correct, then this is not a bug in coreutils' touch per-se, but a linux kernel behavior.

I should've looked first at the man page... which states it clearly:

from 'man 2 utimesnsat' :
====
  Permissions requirements
       To  set  both  file timestamps to the current time (i.e., times is NULL, or both tv_nsec fields
       specify UTIME_NOW), either:

       1. the caller must have write access to the file;

       2. the caller's effective user ID must match the owner of the file; or

       3. the caller must have appropriate privileges.

       To make any change other than setting both timestamps to the current time (i.e., times  is  not
       NULL,  and  both  tv_nsec fields are not UTIME_NOW and both tv_nsec fields are not UTIME_OMIT),
       either condition 2 or 3 above must apply.
====

Which means write access (condition 1) is not sufficient to set the time to anything except 'now'.
Therefor it is not a coreutils bug - but a linux kernel requirement.

As such, I'm making this as 'closed' - but discussion is welcomed to continue.

regards,
 - assaf





This bug report was last modified 6 years and 214 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.