Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Aug 2008 14:09:44 GMT
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 146622 for review
Message-ID:  <200808041409.m74E9i2i059953@repoman.freebsd.org>

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

Change 146622 by trasz@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);
+	}
 }



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