From owner-freebsd-standards@FreeBSD.ORG Fri Nov 16 13:38:20 2007 Return-Path: Delivered-To: standards@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 546D716A420 for ; Fri, 16 Nov 2007 13:38:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx03.syd.optusnet.com.au (fallbackmx03.syd.optusnet.com.au [211.29.133.136]) by mx1.freebsd.org (Postfix) with ESMTP id CB20213C43E for ; Fri, 16 Nov 2007 13:38:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail10.syd.optusnet.com.au (mail10.syd.optusnet.com.au [211.29.132.191]) by fallbackmx03.syd.optusnet.com.au (8.12.11.20060308/8.12.11) with ESMTP id lAG0DEPS017553 for ; Fri, 16 Nov 2007 11:13:15 +1100 Received: from besplex.bde.org (c211-30-219-213.carlnfd3.nsw.optusnet.com.au [211.30.219.213]) by mail10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id lAG0D48N022397 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Nov 2007 11:13:06 +1100 Date: Fri, 16 Nov 2007 11:13:04 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kris Kennaway In-Reply-To: <473CC2A0.8020603@FreeBSD.org> Message-ID: <20071116110621.U10808@besplex.bde.org> References: <473CC2A0.8020603@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: standards@FreeBSD.org Subject: Re: Variant behaviour from truncate over NFS and UFS X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2007 13:38:20 -0000 On Thu, 15 Nov 2007, Kris Kennaway wrote: > I came across the following variant behaviour. On NFS: > > hydra1# cd /nfs > hydra1# touch foo > hydra1# chmod a-w foo > hydra1# ls -l foo > -r--r--r-- 1 4294967294 wheel 0 Nov 15 21:57 foo > hydra1# truncate -s 0 foo > truncate: foo: Permission denied > hydra1# chmod u+w foo > hydra1# truncate -s 0 foo > > Compare to UFS: > > hydra1# cd /tmp > hydra1# touch foo > hydra1# chmod a-w foo > hydra1# truncate -s 0 foo > hydra1# ls -l foo > -r--r--r-- 1 root wheel 0 Nov 15 21:57 foo > > Which is correct? Both, I think. truncate(2) requires write permission, and root always has write permission, but root isn't really root for the nfs case. Anyway, the default of maproot=-2 gives much more annoying nonstandard behaviour than this -- it often prevents root doing things that normal users can do. Bruce