1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Make acl_get_perm_np(3) work with NFSv4 ACLs.

Reviewed by:	kientzle@
MFC after:	1 week
This commit is contained in:
Edward Tomasz Napierala 2010-05-23 08:12:36 +00:00
parent 3c4c08dce7
commit 9fcd375657
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208437
2 changed files with 18 additions and 24 deletions

View File

@ -132,30 +132,6 @@ acl_get_fd_np(int fd, acl_type_t type)
return (aclp);
}
int
acl_get_perm_np(acl_permset_t permset_d, acl_perm_t perm)
{
if (permset_d == NULL) {
errno = EINVAL;
return (-1);
}
switch(perm) {
case ACL_READ:
case ACL_WRITE:
case ACL_EXECUTE:
if (*permset_d & perm)
return (1);
break;
default:
errno = EINVAL;
return (-1);
}
return (0);
}
/*
* acl_get_permset() (23.4.17): return via permset_p a descriptor to
* the permission set in the ACL entry entry_d.

View File

@ -108,3 +108,21 @@ acl_delete_perm(acl_permset_t permset_d, acl_perm_t perm)
return (0);
}
int
acl_get_perm_np(acl_permset_t permset_d, acl_perm_t perm)
{
if (permset_d == NULL) {
errno = EINVAL;
return (-1);
}
if (_perm_is_invalid(perm))
return (-1);
if (*permset_d & perm)
return (1);
return (0);
}