NetBSD Problem Report #29487

From  Tue Feb 22 03:23:55 2005
Return-Path: <>
Received: by (Postfix, from userid 31301)
	id 8777663B400; Tue, 22 Feb 2005 03:23:55 +0000 (UTC)
Message-Id: <>
Date: Tue, 22 Feb 2005 03:23:55 +0000 (UTC)
Subject: NFS client should use VA_UTIMES_NULL to determine whether to use NFSV3SATTRTIME_TOSERVER
X-Send-Pr-Version: www-1.0

>Number:         29487
>Category:       kern
>Synopsis:       NFS client should use VA_UTIMES_NULL to determine whether to use NFSV3SATTRTIME_TOSERVER
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 22 03:24:00 +0000 2005
>Originator:     Guy Harris
>Release:        NetBSD-current
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.



NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.