summaryrefslogtreecommitdiffstats
path: root/lib/libc/posix1e/acl_calc_mask.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/posix1e/acl_calc_mask.c')
-rw-r--r--lib/libc/posix1e/acl_calc_mask.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libc/posix1e/acl_calc_mask.c b/lib/libc/posix1e/acl_calc_mask.c
index 085ac9c..95fd260 100644
--- a/lib/libc/posix1e/acl_calc_mask.c
+++ b/lib/libc/posix1e/acl_calc_mask.c
@@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$");
#include <errno.h>
#include <stdio.h>
+#include "acl_support.h"
+
/*
* acl_calc_mask() (23.4.2): calculate and set the permissions
* associated with the ACL_MASK ACL entry. If the ACL already
@@ -48,6 +50,12 @@ acl_calc_mask(acl_t *acl_p)
acl_t acl_new;
int i, mask_mode, mask_num;
+ if (!_acl_brand_may_be(*acl_p, ACL_BRAND_POSIX)) {
+ errno = EINVAL;
+ return (-1);
+ }
+ _acl_brand_as(*acl_p, ACL_BRAND_POSIX);
+
/*
* (23.4.2.4) requires acl_p to point to a pointer to a valid ACL.
* Since one of the primary reasons to use this function would be
OpenPOWER on IntegriCloud