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 ([EMAIL PROTECTED]). 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 [EMAIL PROTECTED] NAI Labs, Safeport Network Services To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message