PERFORCE change 146622 for review

Edward Tomasz Napierala trasz at FreeBSD.org
Mon Aug 4 14:09:44 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=146622

Change 146622 by trasz at trasz_traszkan on 2008/08/04 14:09:33

	If ls(1) cannot read ACL due to EACCES or EPERM, then there
	is obviously some ACL denying it.  Mark file with "+" in that
	case.

Affected files ...

.. //depot/projects/soc2008/trasz_nfs4acl/TODO#28 edit
.. //depot/projects/soc2008/trasz_nfs4acl/bin/ls/print.c#3 edit

Differences ...

==== //depot/projects/soc2008/trasz_nfs4acl/TODO#28 (text+ko) ====

@@ -2,9 +2,6 @@
 
 - Make setfacl(1) error messages more user friendly.
 
-- Correctly handle the situation in which we can stat, but cannot
-  read ACL, in ls(1).
-
 - Clean up #defines.  For example, make VREAD_NAMED_ATTRS equal
   to ACL_READ_NAMED_ATTRS, so there is no need for translation
   between the two in kern/subr_acl_nfs4.c.

==== //depot/projects/soc2008/trasz_nfs4acl/bin/ls/print.c#3 (text+ko) ====

@@ -666,6 +666,14 @@
 			buf[10] = '+';
 
 		acl_free(facl);
-	} else
+	} else {
+		/*
+		 * We were denied access.  So, obviously, there
+		 * is some ACL denying READ_ACL there.
+		 */
+		if (errno == EPERM || errno == EACCES)
+			buf[10] = '+';
+
 		warn("%s", name);
+	}
 }


More information about the p4-projects mailing list