svn commit: r208756 - stable/8/lib/libc/posix1e

Edward Tomasz Napierala trasz at FreeBSD.org
Wed Jun 2 20:35:56 UTC 2010


Author: trasz
Date: Wed Jun  2 20:35:56 2010
New Revision: 208756
URL: http://svn.freebsd.org/changeset/base/208756

Log:
  MFC r208437:
  
  Make acl_get_perm_np(3) work with NFSv4 ACLs.
  
  Reviewed by:	kientzle@
  Approved by:	re (kib)

Modified:
  stable/8/lib/libc/posix1e/acl_get.c
  stable/8/lib/libc/posix1e/acl_perm.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/posix1e/acl_get.c
==============================================================================
--- stable/8/lib/libc/posix1e/acl_get.c	Wed Jun  2 19:16:58 2010	(r208755)
+++ stable/8/lib/libc/posix1e/acl_get.c	Wed Jun  2 20:35:56 2010	(r208756)
@@ -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.

Modified: stable/8/lib/libc/posix1e/acl_perm.c
==============================================================================
--- stable/8/lib/libc/posix1e/acl_perm.c	Wed Jun  2 19:16:58 2010	(r208755)
+++ stable/8/lib/libc/posix1e/acl_perm.c	Wed Jun  2 20:35:56 2010	(r208756)
@@ -108,3 +108,21 @@ acl_delete_perm(acl_permset_t permset_d,
 
 	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);
+}


More information about the svn-src-stable-8 mailing list