Austin Group Defect Tracker

Aardvark Mark III


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001280 [1003.1(2016)/Issue7+TC2] System Interfaces Editorial Clarification Requested 2019-08-16 22:45 2019-08-29 15:11
Reporter dalias View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Resolved  
Name Rich Felker
Organization musl libc
User Reference
Section utimensat/futimens
Page Number ?
Line Number ?
Interp Status ---
Final Accepted Text Note: 0004544
Summary 0001280: Error requirements with UTIME_OMIT
Description The DESCRIPTION specifies:

"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)."

Note the "may".

However, under ERRORS, there are "shall fail" errors that would apply under the condition where both times are UTIME_OMIT.
Desired Action Clarify whether these errors are required if both times are UTIME_OMIT. Either add exceptions to the error conditions (e.g. "and not both tv_nsec fields are set to UTIME_OMIT") or replace the "may" in the description with appropriate wording not to imply that these errors are optional.

Note: Linux kernel does not detect any errors in the case where both are UTIME_OMIT. I'm not aware of what other implementations do.
Tags tc3-2008
Attached Files

- Relationships

-  Notes
(0004529)
geoffclare (manager)
2019-08-19 08:51

I believe the intention was to allow implementations to notice that both times specify UTIME_OMIT and return straight away without making any use of the path or fd. So the "may" in the DESCRIPTION is right and the ERRORS section needs updating.

Rather than having to repeat most errors in "shall fail" and "may fail" forms, perhaps we can do something like this in the intro to each set of errors that are currently "shall fail":
The utimes() function shall fail, the futimens() and utimensat() functions shall fail in the case that the times argument does not have both tv_nsec fields set to UTIME_OMIT, and the futimens() and utimensat() functions may fail in the case that the times argument has both tv_nsec fields set to UTIME_OMIT, if:
(0004531)
dalias (reporter)
2019-08-19 14:51

That looks fine to me. I'm happy with any outcome for this that clarifies the intent. I only hit the issue working on tests for my implementation in conjunction with 64-bit time_t work and wasn't sure what the correct behavior should be.
(0004544)
geoffclare (manager)
2019-08-28 09:29

Proposed changes ...

On page 988 line 33571 section futimens(), change:
These functions shall fail if
to:
The utimes() function shall fail, the futimens() and utimensat() functions shall fail in the case that the times argument does not have both tv_nsec fields set to UTIME_OMIT, and the futimens() and utimensat() functions may fail in the case that the times argument has both tv_nsec fields set to UTIME_OMIT, if

On page 988 line 33585 section futimens(), change:
The futimens() function shall fail if
to:
The futimens() function shall fail in the case that the times argument does not have both tv_nsec fields set to UTIME_OMIT, and may fail in the case that the times argument has both tv_nsec fields set to UTIME_OMIT, if

On page 988 line 33587 section futimens(), change:
The utimensat() function shall fail if
to:
The utimensat() function shall fail in the case that the times argument does not have both tv_nsec fields set to UTIME_OMIT, and may fail in the case that the times argument has both tv_nsec fields set to UTIME_OMIT, if

On page 988 line 33595 section futimens(), change:
The utimensat() and utimes() functions shall fail if
to:
The utimes() function shall fail, the utimensat() function shall fail in the case that the times argument does not have both tv_nsec fields set to UTIME_OMIT, and the utimensat() function may fail in the case that the times argument has both tv_nsec fields set to UTIME_OMIT, if

- Issue History
Date Modified Username Field Change
2019-08-16 22:45 dalias New Issue
2019-08-16 22:45 dalias Name => Rich Felker
2019-08-16 22:45 dalias Organization => musl libc
2019-08-16 22:45 dalias Section => utimensat/futimens
2019-08-16 22:45 dalias Page Number => ?
2019-08-16 22:45 dalias Line Number => ?
2019-08-19 08:51 geoffclare Note Added: 0004529
2019-08-19 14:51 dalias Note Added: 0004531
2019-08-28 09:29 geoffclare Note Added: 0004544
2019-08-29 15:11 geoffclare Interp Status => ---
2019-08-29 15:11 geoffclare Final Accepted Text => Note: 0004544
2019-08-29 15:11 geoffclare Status New => Resolved
2019-08-29 15:11 geoffclare Resolution Open => Accepted As Marked
2019-08-29 15:11 geoffclare Tag Attached: tc3-2008


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker