Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/posix1e/acl_strip.c
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | _nfs4_acl_strip_np(const acl_t aclp, int canonical_six) | ||||
return (newacl); | return (newacl); | ||||
} | } | ||||
static acl_t | static acl_t | ||||
_posix1e_acl_strip_np(const acl_t aclp, int recalculate_mask) | _posix1e_acl_strip_np(const acl_t aclp, int recalculate_mask) | ||||
{ | { | ||||
acl_t acl_new, acl_old; | acl_t acl_new, acl_old; | ||||
acl_entry_t entry, entry_new; | acl_entry_t entry, entry_new; | ||||
acl_permset_t perm; | |||||
acl_tag_t tag; | acl_tag_t tag; | ||||
int entry_id, have_mask_entry; | int entry_id, have_mask_entry; | ||||
assert(_acl_brand(aclp) == ACL_BRAND_POSIX); | assert(_acl_brand(aclp) == ACL_BRAND_POSIX); | ||||
acl_old = acl_dup(aclp); | acl_old = acl_dup(aclp); | ||||
if (acl_old == NULL) | if (acl_old == NULL) | ||||
return (NULL); | return (NULL); | ||||
Show All 17 Lines | while (acl_get_entry(acl_old, entry_id, &entry) == 1) { | ||||
if (acl_get_tag_type(entry, &tag) == -1) | if (acl_get_tag_type(entry, &tag) == -1) | ||||
goto fail; | goto fail; | ||||
switch(tag) { | switch(tag) { | ||||
case ACL_USER_OBJ: | case ACL_USER_OBJ: | ||||
case ACL_GROUP_OBJ: | case ACL_GROUP_OBJ: | ||||
case ACL_OTHER: | case ACL_OTHER: | ||||
if (acl_get_tag_type(entry, &tag) == -1) | |||||
goto fail; | |||||
if (acl_get_permset(entry, &perm) == -1) | |||||
goto fail; | |||||
if (acl_create_entry(&acl_new, &entry_new) == -1) | if (acl_create_entry(&acl_new, &entry_new) == -1) | ||||
goto fail; | |||||
if (acl_set_tag_type(entry_new, tag) == -1) | |||||
goto fail; | |||||
if (acl_set_permset(entry_new, perm) == -1) | |||||
goto fail; | goto fail; | ||||
if (acl_copy_entry(entry_new, entry) == -1) | if (acl_copy_entry(entry_new, entry) == -1) | ||||
goto fail; | goto fail; | ||||
assert(_entry_brand(entry_new) == ACL_BRAND_POSIX); | assert(_entry_brand(entry_new) == ACL_BRAND_POSIX); | ||||
break; | break; | ||||
case ACL_MASK: | case ACL_MASK: | ||||
have_mask_entry = 1; | have_mask_entry = 1; | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |