Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Nov 2007 01:27:52 +0100
From:      Kris Kennaway <kris@FreeBSD.org>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        standards@FreeBSD.org
Subject:   Re: Variant behaviour from truncate over NFS and UFS
Message-ID:  <473CE408.1030901@FreeBSD.org>
In-Reply-To: <20071116110621.U10808@besplex.bde.org>
References:  <473CC2A0.8020603@FreeBSD.org> <20071116110621.U10808@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans wrote:
> 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.

Ah yes, thanks for clarifying.

Kris




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?473CE408.1030901>