RFC: futimens(2) and utimensat(2)
Jilles Tjoelker
jilles at stack.nl
Fri Mar 2 22:25:30 UTC 2012
On Wed, Feb 29, 2012 at 02:21:23PM +0300, Sergey Kandaurov wrote:
> On 29 February 2012 10:40, Xin Li <delphij at delphij.net> wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA256
> > These are required by IEEE Std 1003.1-2008. ?Patchset at:
> > http://people.freebsd.org/~delphij/for_review/utimens.diff
> First, thank you very much for doing this.
> ERRORS section for utimes(2) is still not updated (not exists).
> Funny but that was the most difficult part to implement these
> syscalls a year ago with the great help from jilles at .
> He could further comment on your patchset.
> Otherwise looks good and pretty similar to my work, though
> I didn't use a "const" modifier in my version for both functions
> and syscall definitions in syscall.master for some reasons.
> Further I wrote a test to see how properly implementation detects
> EACCES/EPERM with different UTIME_OMIT/UTIME_NOW passed. It shall pass
> all tests as shown in the table (stolen somewhere from austingroup):
> [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]
> Here NULL also covers cases when:
> - both fields are UTIME_NULL
> - both fields are UTIME_OMIT.
If both fields are UTIME_NOW, this shall be the same as a NULL pointer.
If both fields are UTIME_OMIT, the timestamps remain unchanged; no
permission check shall be performed for the file itself but may be
performed for the path prefix (an earlier patch from pluknet returned
success immediately).
Otherwise, the above is correct.
Note that if one field is UTIME_NOW and the other is UTIME_OMIT, there
is no special case: the caller must be owner or root.
--
Jilles Tjoelker
More information about the freebsd-arch
mailing list