Fix for [Bug 4543] - POSIX ACL support on FreeBSD.
authorobnox <obnox@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Thu, 10 May 2007 13:31:15 +0000 (13:31 +0000)
committerobnox <obnox@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Thu, 10 May 2007 13:31:15 +0000 (13:31 +0000)
This adds vfs_posixacl to the list of static modules and
makes use of HAVE_ACL_GET_PERM_NP.

This is just a quick fix. FreeBSD acl support is still
hardcoded in configure.in, but actually this could be
detected in a unified test for freebsd, linux, *,
as suggested in the bugreport. This has still to be
checked and elaborated.

Michael

git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_3_0@22777 0c0555d6-39d7-0310-84fc-f1cc0bd64818

source/configure.in
source/modules/vfs_posixacl.c

index b938812812c578be8689da772020fe2e6c7be392..718baed3025625558984714d6e13e3bfab37c5e3 100644 (file)
@@ -5303,6 +5303,7 @@ AC_ARG_WITH(acl-support,
                AC_MSG_RESULT(Using FreeBSD posix ACLs)
                AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether FreeBSD POSIX ACLs are available])
                AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
+               default_static_modules="$default_static_modules vfs_posixacl"
                ;;
        *linux*)
                AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
index 191c4a7cb0e11733c7e770424eba5091bbd53b53..109c1e20b2ef24cc65b4254d87f4f016af4d69a9 100644 (file)
@@ -200,9 +200,15 @@ static BOOL smb_ace_to_internal(acl_entry_t posix_ace,
                return False;
        }
        ace->a_perm = 0;
+#ifdef HAVE_ACL_GET_PERM_NP
+       ace->a_perm |= (acl_get_perm_np(permset, ACL_READ) ? SMB_ACL_READ : 0);
+       ace->a_perm |= (acl_get_perm_np(permset, ACL_WRITE) ? SMB_ACL_WRITE : 0);
+       ace->a_perm |= (acl_get_perm_np(permset, ACL_EXECUTE) ? SMB_ACL_EXECUTE : 0);
+#else
        ace->a_perm |= (acl_get_perm(permset, ACL_READ) ? SMB_ACL_READ : 0);
        ace->a_perm |= (acl_get_perm(permset, ACL_WRITE) ? SMB_ACL_WRITE : 0);
        ace->a_perm |= (acl_get_perm(permset, ACL_EXECUTE) ? SMB_ACL_EXECUTE : 0);
+#endif
        return True;
 }