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

next in thread | previous in thread | raw e-mail | index | archive | help
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



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