On Sat, Jan 17, 2015 at 4:59 PM, Rob Landley <r...@landley.net> wrote:
> On 01/17/2015 01:53 PM, Rob Landley wrote:
>> On 01/17/2015 12:09 AM, enh wrote:
>> So anyway I checked that in, and now I'm porting your patch on top of
>> that change and I hit the _weirdest_ thing where "./touch nonexistent"
>> doesn't cause an error because utimensat() on a file that didn't exist
>> returned ok (file still doesn't exist afterwards),
>
> Because if both timestamps have nanoseconds set to UTIME_OMIT it returns
> success even if the file did not exist.
>
> Possibly the man page should mention that.

yeah, the Linux man page probably based its text on the POSIX "may":
"If both tv_nsec fields are set to UTIME_OMIT, no ownership or
permissions check shall be performed for the file, but other error
conditions may still be detected (including [EACCES] errors related to
the path prefix)."

the comment in the kernel source raises this to a "must not" for some
reason: "/* Nothing to do, we must not even check the path.  */".

i've mailed the linux man pages folks.

(even having read the source to send the patch to strace so that they
[will in future] output the times correctly for UTIME_NOW and
UTIME_OMIT when the seconds field isn't 0, and even though "must not
even check the path" is explicitly stated, i guess that was so
obviously wrong it didn't pass my plausibility filter. lucky you had a
test for that case!)

>> and when it does this its argument variable becomes NULL
>
> Was debugging debris (bug introduced by adding debugging code).
>
> Rob
_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to