Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Dec 2001 18:09:26 -0500 (EST)
From:      Robert Watson <rwatson@freebsd.org>
To:        Daniel Rock <D.Rock@t-online.de>
Cc:        current@freebsd.org
Subject:   Re: Inconsistencies in *stat() for files with ACLs
Message-ID:  <Pine.NEB.3.96L.1011202180538.21930A-100000@fledge.watson.org>
In-Reply-To: <3C0A8AE7.4CCD8B42@t-online.de>

next in thread | previous in thread | raw e-mail | index | archive | help

On Sun, 2 Dec 2001, Daniel Rock wrote:

> Hi,
> 
> lstat(), fstat(), stat() returned structure is inconsistent and
> misleading if the file has ACLs associated with it. 

That behavior is defined by POSIX.1e, so it's what we implemented; you'll
find that the same behavior is present on other platforms with conforming
implementations.

It actually does make some sense, when you think about it: POSIX.1e
requires that the group permissions returned by stat() be the ACL_MASK
entry if an extended ACL is present.  That means that stat() displays the
"worst case" protections.  Likewise, the spec requires that chmod() modify
the ACL_MASK entry if an extended ACL is present, which gives you
conservative behavior: if group write is removed, "the right thing
happens".  For example, if you chmod 0600 on the file, it "works": 
POSIX.1e considers the "extended ACL" to expand the group entry of the
permissions. 

That said, I won't argue it's intuitive unless you know about the behavior
already, and it probably should be documented in the stat(2) man page.  If
you're interested in discussing these semantics, it might be worth raising
it on the POSIX.1e mailing list (posix1e@cyrus.watson.org).  A number of
people involved in writing the spec are there, and in the past it has been
a successful forum for discussing ambiguities (not to mention mistakes) in
the spec. 

Robert N M Watson             FreeBSD Core Team, TrustedBSD Project
robert@fledge.watson.org      NAI Labs, Safeport Network Services



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1011202180538.21930A-100000>