misc/77902: NFS client should use VA_UTIMES_NULL to determine
whether to use NFSV3SATTRTIME_TOSERVER
guy at alum.mit.edu
Tue Feb 22 02:50:15 GMT 2005
>Synopsis: NFS client should use VA_UTIMES_NULL to determine whether to use NFSV3SATTRTIME_TOSERVER
>Arrival-Date: Tue Feb 22 02:50:14 GMT 2005
>Originator: Guy Harris
The NFS client code currently checks whether a time in the vattr structure is the current time or not and, if so, sends NFSV3SATTRTIME_TOSERVER over the wire.
As I remember, the intent of NFSV3SATTRTIME_TOSERVER was, among other things, to support the "touch without writing" semantics of "utime(..., NULL)" and "utimes(..., NULL)". The difference between those isn't based on the time specified in the attribute structure, it's based on whether a null times pointer was passed in.
The utimes() man page says:
All of the system calls will fail if:
[EACCES] The times argument is NULL and the effective user ID
of the process does not match the owner of the file,
and is not the super-user, and write access is denied.
[EPERM] The times argument is not NULL and the calling
process's effective user ID does not match the owner
of the file and is not the super-user.
indicating that the permission checking, at least, should be based not on the times specified, but on whether any times were specified at all. At least some NFS servers base the permission checking on NFSV3SATTRTIME_TOSERVER vs. NFSV3SATTRTIME_TOCLIENT (at least as I remember, that's what I did when I did the NFSv3 in NetApp's servers), so NFSV3SATTRTIME_TOSERVER vs. NFSV3SATTRTIME_TOCLIENT should reflect whether the times were null or not, i.e. it should check whether VA_UTIMES_NULL is set in va_vaflags.
More information about the freebsd-bugs