Subject: kern/29487: NFS client should use VA_UTIMES_NULL to determine whether to use NFSV3SATTRTIME_TOSERVER
To: None <firstname.lastname@example.org, email@example.com,>
From: None <firstname.lastname@example.org>
Date: 02/22/2005 03:24:00
>Synopsis: NFS client should use VA_UTIMES_NULL to determine whether to use NFSV3SATTRTIME_TOSERVER
>Arrival-Date: Tue Feb 22 03:24:00 +0000 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.