Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Nov 2010 21:04:05 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216084 - head/sys/cddl/compat/opensolaris/kern
Message-ID:  <201011302104.oAUL45KN034093@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Tue Nov 30 21:04:05 2010
New Revision: 216084
URL: http://svn.freebsd.org/changeset/base/216084

Log:
  Don't panic when we read an empty ACL from ZFS.  Apparently this may happen
  with filesystems created under MacOS X ZFS port.  This is kind of filesystem
  corruption (we don't allow for setting empty ACLs), so make acl_get_file(3)
  and related syscalls fail with EINVAL in that case.  In theory, we could
  return empty ACL to userland, but I'm afraid this would break some code.
  
  MFC after:	3 days

Modified:
  head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c

Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c
==============================================================================
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c	Tue Nov 30 20:54:14 2010	(r216083)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c	Tue Nov 30 21:04:05 2010	(r216084)
@@ -105,7 +105,10 @@ acl_from_aces(struct acl *aclp, const ac
 	struct acl_entry *entry;
 	const ace_t *ace;
 
-	KASSERT(nentries >= 1, ("empty ZFS ACL"));
+	if (nentries < 1) {
+		printf("acl_from_aces: empty ZFS ACL; returning EINVAL.\n");
+		return (EINVAL);
+	}
 
 	if (nentries > ACL_MAX_ENTRIES) {
 		/*



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