stat flag to indicate presence of an extended ACL

Tim Kientzle kientzle at freebsd.org
Wed Apr 14 04:18:00 GMT 2004


Robert Watson wrote:
> On Tue, 13 Apr 2004, Tim Kientzle wrote:
> 
>>Ideally, I'd like some piece of data in struct stat that I can use to
>>tell whether or not there is extended ACL data for this file.  (Maybe a
>>read-only bit in st_flags that indicates "extended ACL exists"?) 
> 
> When we first explored doing this (so as to implement '+' output in
> ls(1)), I discovered ... no free bits in the st_mode field.

st_mode?  Hmmm... I was thinking of st_flags, actually, which
has lots of free space.  At least it does in the FreeBSD 5.1
version of sys/stat.h that I'm looking at right now.

I was thinking of changing SF_SETTABLE to 0x0fff0000
and then using the upper 4 flag bits to indicate
special file properties (e.g., "has extended access ACL",
"has default ACL", "has extended attributes", ...).

> ... you'd need semantics that support
> ls(1)'s need to display a flag for an extended access ACL,

I always assumed ls showed a '+' for a default ACL as well,
though I've never tested.  I guess ls.1 doesn't really say.

> for tar to detect the presence of access or default ACLs.  Which suggests
> possibly two flags, one for default, and one for access.

That would be nice.  To be honest, I would be happy with
just a flag for extended access ACLs, since that's the one
that hurts (there are generally fewer directories than
files, so default ACLs are less pain).  Just the one
bit to flag the presence of an extended access ACL would help a lot
with any program that needed to examine ACL data for lots of
files (find, tar, ls, cp -r, cpio, ...).

Of course, if you're offering both, I won't turn you down.  ;-)

Tim


To Unsubscribe: send mail to majordomo at cyrus.watson.org
with "unsubscribe posix1e" in the body of the message



More information about the posix1e mailing list