NetBSD Problem Report #29487

From www@netbsd.org  Tue Feb 22 03:23:55 2005
Return-Path: <www@netbsd.org>
Received: by narn.netbsd.org (Postfix, from userid 31301)
	id 8777663B400; Tue, 22 Feb 2005 03:23:55 +0000 (UTC)
Message-Id: <20050222032355.8777663B400@narn.netbsd.org>
Date: Tue, 22 Feb 2005 03:23:55 +0000 (UTC)
From: guy@alum.mit.edu
Reply-To: guy@alum.mit.edu
To: gnats-bugs@netbsd.org
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
>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:

NetBSD Home
NetBSD PR Database Search

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