Author: trasz
Date: Tue Dec  7 22:00:48 2010
New Revision: 216271
URL: http://svn.freebsd.org/changeset/base/216271

Log:
  MFC r216084:
  
  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.
  
  Approved by:  re (kib)

Modified:
  stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c
==============================================================================
--- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c Tue Dec  7 
21:39:36 2010        (r216270)
+++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c Tue Dec  7 
22:00:48 2010        (r216271)
@@ -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) {
                /*
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to