SF.net SVN: gar:[25794] csw/mgar/pkg/samba/branches/samba4

janholzh at users.sourceforge.net janholzh at users.sourceforge.net
Wed Jun 29 15:48:26 CEST 2016


Revision: 25794
          http://sourceforge.net/p/gar/code/25794
Author:   janholzh
Date:     2016-06-29 13:48:26 +0000 (Wed, 29 Jun 2016)
Log Message:
-----------
samba/branches/samba4: add patch to make zfs as sysvol work, still needs adjustment after provision in smb.conf

Modified Paths:
--------------
    csw/mgar/pkg/samba/branches/samba4/Makefile

Added Paths:
-----------
    csw/mgar/pkg/samba/branches/samba4/files/0004-Add-zfs-to-provision-support.patch

Modified: csw/mgar/pkg/samba/branches/samba4/Makefile
===================================================================
--- csw/mgar/pkg/samba/branches/samba4/Makefile	2016-06-29 13:09:11 UTC (rev 25793)
+++ csw/mgar/pkg/samba/branches/samba4/Makefile	2016-06-29 13:48:26 UTC (rev 25794)
@@ -27,7 +27,7 @@
 LINKER_MAPS_5.10 ?= -M "$(abspath $(WORKDIR)/map.solaris)"
 LINKER_MAPS = $(LINKER_MAPS_$(GAROSREL))
 
-BUILD_DEP_PKGS += CSWlibtalloc-dev
+#BUILD_DEP_PKGS += CSWlibtalloc-dev
 BUILD_DEP_PKGS += CSWlibpopt-dev
 BUILD_DEP_PKGS += CSWlibgamin-dev
 BUILD_DEP_PKGS += CSWlibintl8
@@ -75,6 +75,10 @@
 #from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208767
 #PATCHFILES += 0004-fix_clearenv.patch
 
+# Add a patch to be able to do s3fs provison of AD. You need to edit smb.conf after that.
+# http://markmail.org/message/n3iqsplcermy6ast#query:+page:1+mid:uu2drll22g2eo5jl+state:results
+PATCHFILES += 0004-Add-zfs-to-provision-support.patch
+
 NOGITPATCH += 1
 
 # Filesystem layout
@@ -89,10 +93,13 @@
 SMB_VFS_MODULES_B = vfs_recycle,vfs_netatalk,vfs_readonly,vfs_cap,vfs_expand_msdfs,vfs_shadow_copy,vfs_shadow_copy2
 #Solaris_acl needs to be linked static
 #SMB_VFS_MODULES_C = vfs_xattr_tdb,vfs_posix_eadb,vfs_solarisacl,vfs_zfsacl,vfs_catia
-SMB_VFS_MODULES_C = vfs_xattr_tdb,vfs_posix_eadb,vfs_zfsacl,vfs_catia
-SMB_VFS_MODULES_D = vfs_streams_xattr,vfs_streams_depot,vfs_cacheprime,vfs_prealloc,vfs_commit,vfs_notify_fam
+#SMB_VFS_MODULES_C = vfs_xattr_tdb,vfs_posix_eadb,vfs_zfsacl,vfs_catia
+SMB_VFS_MODULES_C = vfs_posix_eadb,vfs_zfsacl,vfs_catia
+#SMB_VFS_MODULES_D = vfs_streams_xattr,vfs_streams_depot,vfs_cacheprime,vfs_prealloc,vfs_commit,vfs_notify_fam
+SMB_VFS_MODULES_D = vfs_streams_depot,vfs_cacheprime,vfs_prealloc,vfs_commit,vfs_notify_fam
 SMB_VFS_MODULES_E = vfs_readahead,vfs_aio_pthread,vfs_aio_posix,vfs_preopen,vfs_syncops
-SMB_VFS_MODULES_F = vfs_acl_xattr,vfs_acl_tdb,vfs_smb_traffic_analyzer,vfs_dirsort,vfs_scannedonly,vfs_crossrename
+#SMB_VFS_MODULES_F = vfs_acl_xattr,vfs_acl_tdb,vfs_smb_traffic_analyzer,vfs_dirsort,vfs_scannedonly,vfs_crossrename
+SMB_VFS_MODULES_F = vfs_acl_tdb,vfs_smb_traffic_analyzer,vfs_dirsort,vfs_scannedonly,vfs_crossrename
 SMB_VFS_MODULES_G = vfs_time_audit,vfs_media_harmony,vfs_dfs_samba4
 SMB_VFS_MODULES = $(SMB_VFS_MODULES_A),$(SMB_VFS_MODULES_B),$(SMB_VFS_MODULES_C),$(SMB_VFS_MODULES_D),$(SMB_VFS_MODULES_E),$(SMB_VFS_MODULES_F),$(SMB_VFS_MODULES_G)
 SMB_IDMAP_MODULES = idmap_ad,idmap_adex,idmap_autorid,idmap_hash,idmap_ldap,idmap_nss,idmap_rid,idmap_tdb,idmap_tdb2

Added: csw/mgar/pkg/samba/branches/samba4/files/0004-Add-zfs-to-provision-support.patch
===================================================================
--- csw/mgar/pkg/samba/branches/samba4/files/0004-Add-zfs-to-provision-support.patch	                        (rev 0)
+++ csw/mgar/pkg/samba/branches/samba4/files/0004-Add-zfs-to-provision-support.patch	2016-06-29 13:48:26 UTC (rev 25794)
@@ -0,0 +1,70 @@
+From a9dafdbbf5bc5aca2982f2d7a791c47ecc6f7259 Mon Sep 17 00:00:00 2001
+From: Jan Holzhueter <jh at opencsw.org>
+Date: Wed, 29 Jun 2016 13:36:36 +0200
+Subject: [PATCH] Add zfs to provision support
+
+---
+ python/samba/provision/__init__.py |  6 ++++--
+ source3/smbd/pysmbd.c              | 15 +++++++++++++++
+ 2 files changed, 19 insertions(+), 2 deletions(-)
+
+diff --git a/python/samba/provision/__init__.py b/python/samba/provision/__init__.py
+index b36a7d2..849394b 100644
+--- a/python/samba/provision/__init__.py
++++ b/python/samba/provision/__init__.py
+@@ -1545,7 +1545,8 @@ def setsysvolacl(samdb, netlogon, sysvol, uid, gid, domainsid, dnsdomain,
+         file = tempfile.NamedTemporaryFile(dir=os.path.abspath(sysvol))
+         try:
+             try:
+-                smbd.set_simple_acl(file.name, 0755, gid)
++                if not smbd.have_zfs_acls():
++                    smbd.set_simple_acl(file.name, 0755, gid)
+             except OSError:
+                 if not smbd.have_posix_acls():
+                     # This clue is only strictly correct for RPM and
+@@ -1557,7 +1558,8 @@ def setsysvolacl(samdb, netlogon, sysvol, uid, gid, domainsid, dnsdomain,
+                 raise ProvisioningError("Your filesystem or build does not support posix ACLs, which s3fs requires.  "
+                                         "Try the mounting the filesystem with the 'acl' option.")
+             try:
+-                smbd.chown(file.name, uid, gid)
++                if not smbd.have_zfs_acls():
++                    smbd.chown(file.name, uid, gid)
+             except OSError:
+                 raise ProvisioningError("Unable to chown a file on your filesystem.  "
+                                         "You may not be running provision as root.")
+diff --git a/source3/smbd/pysmbd.c b/source3/smbd/pysmbd.c
+index df8d079..5e648b4 100644
+--- a/source3/smbd/pysmbd.c
++++ b/source3/smbd/pysmbd.c
+@@ -450,6 +450,18 @@ static PyObject *py_smbd_have_posix_acls(PyObject *self)
+ #endif
+ }
+ 
++/* check whether ZFS acl support has been added
++ */
++static PyObject *py_smbd_have_zfs_acls(PyObject *self)
++{
++#ifdef vfs_zfsacl_init
++       return PyBool_FromLong(true);
++#else
++       return PyBool_FromLong(false);
++#endif
++}
++
++
+ /*
+   set the NT ACL on a file
+  */
+@@ -627,6 +639,9 @@ static PyMethodDef py_smbd_methods[] = {
+ 	{ "have_posix_acls",
+ 		(PyCFunction)py_smbd_have_posix_acls, METH_NOARGS,
+ 		NULL },
++	{ "have_zfs_acls",
++		(PyCFunction)py_smbd_have_zfs_acls, METH_NOARGS,
++		NULL },
+ 	{ "set_simple_acl",
+ 		(PyCFunction)py_smbd_set_simple_acl, METH_VARARGS|METH_KEYWORDS,
+ 		NULL },
+-- 
+2.4.0
+

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list