summaryrefslogtreecommitdiffstats
path: root/lib/libc/posix1e/acl_to_text.c
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2009-09-01 18:30:17 +0000
committertrasz <trasz@FreeBSD.org>2009-09-01 18:30:17 +0000
commit008ef8cd3b3a70e55ea6d9679a97a2b162f99ab2 (patch)
tree7cb6012d0428fe7628ae161aae33175207a7610d /lib/libc/posix1e/acl_to_text.c
parent3c15abf75cb0075339a5b06b9638953cd2ec5db1 (diff)
downloadFreeBSD-src-008ef8cd3b3a70e55ea6d9679a97a2b162f99ab2.zip
FreeBSD-src-008ef8cd3b3a70e55ea6d9679a97a2b162f99ab2.tar.gz
Fix regression introduced with NFSv4 ACL support - make acl_to_text(3)
and acl_calc_mask(3) return error instead of crashing when acl passed to them is NULL. Submitted by: markus Reviewed by: rwatson MFC after: 3 days
Diffstat (limited to 'lib/libc/posix1e/acl_to_text.c')
-rw-r--r--lib/libc/posix1e/acl_to_text.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/posix1e/acl_to_text.c b/lib/libc/posix1e/acl_to_text.c
index 3485b1e..79a950a 100644
--- a/lib/libc/posix1e/acl_to_text.c
+++ b/lib/libc/posix1e/acl_to_text.c
@@ -70,11 +70,6 @@ _posix1e_acl_to_text(acl_t acl, ssize_t *len_p, int flags)
if (buf == NULL)
return(NULL);
- if (acl == NULL) {
- errno = EINVAL;
- return(NULL);
- }
-
acl_int = &acl->ats_acl;
mask_perm = ACL_PERM_BITS; /* effective is regular if no mask */
@@ -243,6 +238,11 @@ char *
acl_to_text_np(acl_t acl, ssize_t *len_p, int flags)
{
+ if (acl == NULL) {
+ errno = EINVAL;
+ return(NULL);
+ }
+
switch (_acl_brand(acl)) {
case ACL_BRAND_POSIX:
return (_posix1e_acl_to_text(acl, len_p, flags));
OpenPOWER on IntegriCloud