[PATCH] FreeBSD: catch ACL_EVERYONE in POSIX ACLs

Ralph Böhme rb at sernet.de
Fri Oct 10 06:24:20 MDT 2014


Hi all!

Attached find a patch that may be useful for our users by providing a
meaningful diagnostic.

This happens if you export ZFS with Samba on FreeBSD on don't enable
vfs_zfsacl. Without the patch the log gets filled with this message

...   ../source3/modules/vfs_posixacl.c:171(smb_ace_to_internal)
...   unknown tag type 64

Reference:
<https://lists.samba.org/archive/samba/2014-August/184104.html>

-Ralph

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de,mailto:kontakt@sernet.de
-------------- next part --------------
>From 4ab3387a3fd101811e207fc0cf91a51029a9168c Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Fri, 10 Oct 2014 13:53:56 +0200
Subject: [PATCH] vfs_posixacl: catch ACL_EVERYONE on FreeBSD

Using POSIX ACL API on FreeBSD may return NFSv4 style tag type
ACL_EVERYONE. Catch the error and issue a helpful log message telling
users to enable zfsacl VFS module.

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source3/modules/vfs_posixacl.c | 5 +++++
 source3/wscript                | 1 +
 2 files changed, 6 insertions(+)

diff --git a/source3/modules/vfs_posixacl.c b/source3/modules/vfs_posixacl.c
index 6963aae..b158d45 100644
--- a/source3/modules/vfs_posixacl.c
+++ b/source3/modules/vfs_posixacl.c
@@ -167,6 +167,11 @@ static bool smb_ace_to_internal(acl_entry_t posix_ace,
 	case ACL_MASK:
 		ace->a_type = SMB_ACL_MASK;
 		break;
+#ifdef HAVE_ACL_EVERYONE
+	case ACL_EVERYONE:
+		DEBUG(1, ("ACL tag type ACL_EVERYONE. FreeBSD with ZFS? Use 'vfs objects = zfsacl'\n"));
+		return False;
+#endif
 	default:
 		DEBUG(0, ("unknown tag type %d\n", (unsigned int)tag));
 		return False;
diff --git a/source3/wscript b/source3/wscript
index b285c5f..4f182bf 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -476,6 +476,7 @@ return acl_get_perm_np(permset_d, perm);
                         headers='sys/types.h sys/acl.h', link=True,
                         msg="Checking whether acl_get_perm_np() is available")
                 default_static_modules.extend(TO_LIST('vfs_posixacl'))
+                conf.CHECK_VARIABLE('ACL_EVERYONE', headers='sys/acl.h')
             elif conf.CHECK_FUNCS_IN(['facl'], 'sec'):
                 Logs.info('Using solaris or UnixWare ACLs')
                 conf.DEFINE('HAVE_SOLARIS_UNIXWARE_ACLS',1)
-- 
2.1.0



More information about the samba-technical mailing list