Re: getting ACLs
Re: getting ACLs
- Subject: Re: getting ACLs
- From: Jason Coco <email@hidden>
- Date: Tue, 6 Jan 2009 05:14:36 -0500
On Jan 5, 2009, at 10:45 , John Michael Zorko wrote:
Hello, all ...
I'm exploring the acl_* POSIX APIs on Leopard (and assuming the same
code will work on TIger, please correct me if i'm wrong), and so
far, all I get from acl_get_file() is error 22, "invalid argument".
Here's my (very short) test, can someone tell me what i'm doing wrong?
Two quick things about this... first of all, the only ACL_TYPE that is
supported is ACL_TYPE_EXTENDED, so you have to use that on darwin.
Second, just be aware that if there are no ACL entries actually on a
file, you're going to get ENOENT returned, which can be quite
misleading as the file actually does exist but simply doesn't have an
ACL record associated with it :)
I would suggest using acl_get_fd(3) instead. This way, you will know
if a file doesn't exist because the call to open(2) will fail, so if
acl_get_fd(3) fails and errno is ENOENT then you know that it just
doesn't have any ACL record associated with it. Also, acl_get_fd(3)
doesn't take an acl_type_t so it's less confusing, the only parameter
is the file descriptor.
HTH, Jason
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >getting ACLs (From: John Michael Zorko <email@hidden>) |