Re: Determining if a volume support
Re: Determining if a volume support
- Subject: Re: Determining if a volume support
- From: James Peach <email@hidden>
- Date: Mon, 18 Feb 2008 11:49:53 -0800
On Feb 18, 2008, at 11:38 AM, James Bucanek wrote:
I'm trying to determine if a volume supports access control lists
(ACLs). I dug around FSGetVolInfo and FSGetVolParams and can't seem
to find a bit that says "bSupportsACLs".
getattrlist(2) will tell you:
int acl_support(const char * path)
{
struct attrlist alist;
struct dirReplyBlock {
unsigned long length;
struct vol_capabilities_attr volattr;
} reply;
struct statfs volstat;
if (statfs(path, &volstat) != 0) {
perror("statfs");
return 0;
}
memset( &alist, 0, sizeof(alist));
memset( &reply, 0, sizeof(reply));
alist.bitmapcount = ATTR_BIT_MAP_COUNT;
alist.volattr = ATTR_VOL_INFO | ATTR_VOL_CAPABILITIES;
if (getattrlist(volstat.f_mntonname, &alist,
&reply, sizeof(reply), 0) != 0) {
perror("getattrlist");
return 0;
}
if (reply.volattr.valid[VOL_CAPABILITIES_INTERFACES] &
VOL_CAP_INT_EXTENDED_SECURITY
&& reply.volattr.capabilities[VOL_CAPABILITIES_INTERFACES] &
VOL_CAP_INT_EXTENDED_SECURITY) {
return 1;
}
return 0;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden