Fix acl_strip_np(3) breakage introduced in r279962.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2015-09-03 11:31:34 +00:00
parent b0f957f94a
commit 8e6acc531a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=287427

View File

@ -107,13 +107,13 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculate_mask)
if (acl_get_permset(entry, &perm) == -1)
goto fail;
if (acl_create_entry(&acl_new, &entry_new) == -1)
return (NULL);
goto fail;
if (acl_set_tag_type(entry_new, tag) == -1)
return (NULL);
goto fail;
if (acl_set_permset(entry_new, perm) == -1)
return (NULL);
goto fail;
if (acl_copy_entry(entry_new, entry) == -1)
return (NULL);
goto fail;
assert(_entry_brand(entry_new) == ACL_BRAND_POSIX);
break;
case ACL_MASK:
@ -122,20 +122,22 @@ _posix1e_acl_strip_np(const acl_t aclp, int recalculate_mask)
default:
break;
}
fail:
acl_free(acl_new);
acl_free(acl_old);
return (NULL);
}
assert(_acl_brand(acl_new) == ACL_BRAND_POSIX);
if (have_mask_entry && recalculate_mask) {
if (acl_calc_mask(&acl_new) == -1)
return (NULL);
goto fail;
}
return (acl_new);
fail:
acl_free(acl_new);
acl_free(acl_old);
return (NULL);
}
acl_t