Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Aug 2008 09:41:24 GMT
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 147430 for review
Message-ID:  <200808150941.m7F9fOAY056945@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=147430

Change 147430 by trasz@trasz_traszkan on 2008/08/15 09:40:37

	Fix default ACL support.

Affected files ...

.. //depot/projects/soc2008/trasz_nfs4acl/bin/setfacl/setfacl.c#12 edit
.. //depot/projects/soc2008/trasz_nfs4acl/tools/regression/acltools/tools-posix.test#3 edit

Differences ...

==== //depot/projects/soc2008/trasz_nfs4acl/bin/setfacl/setfacl.c#12 (text+ko) ====

@@ -90,8 +90,11 @@
 			return (NULL);
 		}
 
-		if (S_ISDIR(sb.st_mode) == 0)
+		if (S_ISDIR(sb.st_mode) == 0) {
+			warnx("%s: default ACL may only be set on a directory",
+			    filename);
 			return (NULL);
+		}
 
 		if (h_flag)
 			acl = acl_get_link_np(filename, ACL_TYPE_DEFAULT);
@@ -257,8 +260,6 @@
 
 		if (acl_type != ACL_TYPE_DEFAULT && pathconf(file->filename, _PC_EXTENDED_SECURITY_NP))
 			acl_type = ACL_TYPE_NFS4;
-		else
-			acl_type = ACL_TYPE_ACCESS;
 
 		/* cycle through each option */
 		TAILQ_FOREACH(entry, &entrylist, next) {

==== //depot/projects/soc2008/trasz_nfs4acl/tools/regression/acltools/tools-posix.test#3 (text+ko) ====

@@ -63,7 +63,7 @@
 > mask::r--
 > other::r--
 
-# Make sure cp without any flags does not copy copy the ACL.
+# Make sure cp without any flags does not copy the ACL.
 $ cp xxx yyy
 $ ls -l yyy | cut -d' ' -f1
 > -rw-r--r--
@@ -150,8 +150,42 @@
 > mask::rw-
 > other::---
 
-# XXX: Test default ACLs.
-# XXX: Test inheritance.
+# Test default ACLs.
+$ umask 022
+$ mkdir ddd
+$ getfacl -qn ddd
+> user::rwx
+> group::r-x
+> other::r-x
+
+$ getfacl -dqn ddd
+$ setfacl -d -m u::rwx,g::rx,o::rx,mask::rwx ddd
+$ getfacl -dqn ddd
+> user::rwx
+> group::r-x
+> mask::rwx
+> other::r-x
+
+$ setfacl -dm g:42:rwx,u:42:r ddd
+$ setfacl -dm g::w ddd
+$ getfacl -dqn ddd
+> user::rwx
+> user:42:r--
+> group::-w-
+> group:42:rwx
+> mask::rwx
+> other::r-x
+
+$ setfacl -dx group:42: ddd
+$ getfacl -dqn ddd
+> user::rwx
+> user:42:r--
+> group::-w-
+> mask::rw-
+> other::r-x
+
+> # XXX: Test inheritance.
 
+$ rmdir ddd
 $ rm xxx
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808150941.m7F9fOAY056945>