From owner-freebsd-bugs@FreeBSD.ORG Tue Feb 22 02:50:15 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1325A16A4CE for ; Tue, 22 Feb 2005 02:50:15 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C0E2943D3F for ; Tue, 22 Feb 2005 02:50:14 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j1M2oE1r058068 for ; Tue, 22 Feb 2005 02:50:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j1M2oEcX058066; Tue, 22 Feb 2005 02:50:14 GMT (envelope-from gnats) Resent-Date: Tue, 22 Feb 2005 02:50:14 GMT Resent-Message-Id: <200502220250.j1M2oEcX058066@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Guy Harris Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EC47816A4CE for ; 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 ; 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 ; 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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: misc/77902: NFS client should use VA_UTIMES_NULL to determine whether to use NFSV3SATTRTIME_TOSERVER X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Feb 2005 02:50:15 -0000 >Number: 77902 >Category: misc >Synopsis: 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: >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: >Unformatted: