From nobody@FreeBSD.org  Tue Feb 22 02:49:44 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id EC47816A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 Feb 2005 02:49:44 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id CDC8043D46
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 Feb 2005 02:49:44 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j1M2niPG072921
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 22 Feb 2005 02:49:44 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j1M2niL3072916;
	Tue, 22 Feb 2005 02:49:44 GMT
	(envelope-from nobody)
Message-Id: <200502220249.j1M2niL3072916@www.freebsd.org>
Date: Tue, 22 Feb 2005 02:49:44 GMT
From: Guy Harris <guy@alum.mit.edu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: NFS client should use VA_UTIMES_NULL to determine whether to use NFSV3SATTRTIME_TOSERVER
X-Send-Pr-Version: www-2.3

>Number:         77902
>Category:       kern
>Synopsis:       [nfs] NFS client should use VA_UTIMES_NULL to determine whether to use NFSV3SATTRTIME_TOSERVER
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 22 02:50:14 GMT 2005
>Closed-Date:    
>Last-Modified:  Mon Mar 12 15:23:11 GMT 2007
>Originator:     Guy Harris
>Release:        6.0-current
>Organization:
>Environment:
>Description:
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.

>How-To-Repeat:
      
>Fix:
      
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->cel 
Responsible-Changed-By: cel 
Responsible-Changed-When: Wed May 24 19:35:11 UTC 2006 
Responsible-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=77902 
Responsible-Changed-From-To: cel->freebsd-bugs 
Responsible-Changed-By: cel 
Responsible-Changed-When: Mon Mar 12 15:22:51 UTC 2007 
Responsible-Changed-Why:  
Back to the public pool. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=77902 
>Unformatted:
