The following issue has been SUBMITTED.
======================================================================
http://austingroupbugs.net/view.php?id=63
======================================================================
Reported By: msbrown
Assigned To: ajosey
======================================================================
Project: 1003.1(2008)/Issue 7
Issue ID: 63
Category: System Interfaces
Type: Error
Severity: Comment
Priority: normal
Status: Under Review
Name: Mark Brown
Organization: IBM
User Reference:
Section: futimens
Page Number: 969
Line Number: 32433
Final Accepted Text:
======================================================================
Date Submitted: 2009-06-26 14:14 MST
Last Modified: 2009-06-26 14:14 MST
======================================================================
Summary: EPERM error under futimens() appears to be faulty
Description:
COMMENT Enhancement Request Number
1
michael.kerrisk:xxxxxxxxx Bug in XSHd5 futimens (rdvk#
1)
{utimensat-errs} Wed, 14 May 2008 22:43:49 +0100
(BST)
---------------------
The text describing the EPERM error under futimens() appears to be
faulty.
Consider the following table, which describes the three parameters
affecting the success or failure of these interfaces. In the table,
the columns are:
[a] Is the time argument NULL (or in the case of futimens() and
utimnensat() points to a structure in which both fields are UTIME_NOW
or both are UTIME_OMIT), or does it point to a structure containing
timestamps?
[b] Does the caller's effective UID match the owner of the file?
[c] Is the file writable by the caller's effective UID?
[a] [b] [c]
times file file
arg. UID is
NULL owner writable Result
!NULL !owner !writable
N o w success
N o !w success
N ! w success
N !o !w EACCES [1]
!N o w success
!N o !w success
!N !o w EPERM [2]
!N !o !w EPERM [3]
The fourth column shows the expected result of calling the interface.
However, the text describing the errors does not cover all three error
cases above:
Error case [1] is covered by the EACCES description:
[EACCES]
The times argument is a null pointer, or both tv_nsec values are
UTIME_NOW, and the effective user ID of the process does not match the
owner of the file and write access is denied.
Error case [2] is covered by the EPERM description:
[EPERM]
The times argument is not a null pointer, does not have both tv_nsec
fields set to UTIME_NOW, does not have both tv_nsec fields set to
UTIME_OMIT, the calling process effective user ID has write access to
the file but does not match the owner of the file, and the calling
process does not have appropriate privileges.
Error case [3] is not covered by either of the above descriptions.
Lines 32400-32403 of the draft say :
Only a process with the effective user ID equal to the
user ID of the file or with appropriate privileges may
use futimens() or utimensat() with a non-null times
argument that does not have both tv_nsec fields set to
UTIME_NOW and does not have both tv_nsec fields set to
UTIME_OMIT.
Looking at these lines suggests that the text for the EPERM error
should remove discussion of write access to the file, since the error
applies regardless of whether the file is writable.
Desired Action:
Replace lines 32431 to 32435 with the following:
[EPERM]
The times argument is not a null pointer, does not have both tv_nsec
fields set to UTIME_NOW, does not have both tv_nsec fields set to
UTIME_OMIT, the calling process effective user ID does not match the
owner of the file, and the calling process does not have appropriate
privileges.
======================================================================
|