Fix bug 6865 - acl_xattr module: Has dependency that inherit acls = yes or xattrs...
authorJeremy Allison <jra@samba.org>
Sat, 7 Nov 2009 05:53:07 +0000 (21:53 -0800)
committerJeremy Allison <jra@samba.org>
Sat, 7 Nov 2009 05:53:07 +0000 (21:53 -0800)
Jeremy.

docs-xml/smbdotconf/security/inheritacls.xml
source3/include/proto.h
source3/modules/vfs_acl_tdb.c
source3/modules/vfs_acl_xattr.c
source3/param/loadparm.c

index 44afa8a3e2e38f5aefc49ba10f1fa67479da0121..e2552e32fffbf9f6ead9ca2bb2c1d622b73317bd 100644 (file)
@@ -9,6 +9,11 @@
     behavior is to use the unix mode specified when creating the directory. 
     Enabling this option sets the unix mode to 0777, thus guaranteeing that 
     default directory acls are propagated.
+
+    Note that using the VFS modules acl_xattr or acl_tdb which store native
+    Windows as meta-data will automatically turn this option on for any
+    share for which they are loaded, as they require this option to emulate
+    Windows ACLs correctly.
 </para>
 </description>
 
index 0dbc1c7fed9d6ec7a0b3f05a9245f159197ffe5f..49d01003b58be2975c4fb04725fda3871355493f 100644 (file)
@@ -4373,6 +4373,7 @@ void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val);
 int lp_min_receive_file_size(void);
 char* lp_perfcount_module(void);
 void lp_set_passdb_backend(const char *backend);
+bool set_inherit_acls(int i);
 
 /* The following definitions come from param/util.c  */
 
index 424ecbf65b80c4af7489b0d18c58593c6e8b2731..3d06e520e87a3bd64a2b0e9c3d9f347337266502 100644 (file)
@@ -382,6 +382,12 @@ static int connect_acl_tdb(struct vfs_handle_struct *handle,
        SMB_VFS_HANDLE_SET_DATA(handle, db, free_acl_tdb_data,
                                struct db_context, return -1);
 
+       /* Ensure we have "inherit acls = yes" if we're
+        * using this module. */
+       DEBUG(2,("connect_acl_tdb: setting 'inherit acls = true' for service %s\n",
+               service ));
+       set_inherit_acls(SNUM(handle->conn));
+
        return 0;
 }
 
index 7a9cd27e5fca848eb11318ff33e23650e0f492eb..11ca8902c09d1648637334e1e1bbab5704aa7e04 100644 (file)
@@ -208,8 +208,20 @@ static int sys_acl_set_fd_xattr(vfs_handle_struct *handle,
        return ret;
 }
 
+static int connect_acl_xattr(struct vfs_handle_struct *handle,
+                               const char *service,
+                               const char *user)
+{
+       /* Ensure we have "inherit acls = yes" if we're
+        * using this module. */
+       DEBUG(2,("connect_acl_xattr: setting 'inherit acls = true' for service %s\n",
+               service ));
+       set_inherit_acls(SNUM(handle->conn));
+       return 0;
+}
 
 static struct vfs_fn_pointers vfs_acl_xattr_fns = {
+       .connect_fn = connect_acl_xattr,
        .mkdir = mkdir_acl_common,
        .open = open_acl_common,
        .fget_nt_acl = fget_nt_acl_common,
index c62deb5eda5948e59ef214293423968114ea2310..b317dc6c8a71b12b2bace34332466e010dc28c0b 100644 (file)
@@ -9843,3 +9843,11 @@ void lp_set_passdb_backend(const char *backend)
 {
        string_set(&Globals.szPassdbBackend, backend);
 }
+
+bool set_inherit_acls(int i)
+{
+       if (!LP_SNUM_OK(i)) {
+               return false;
+       }
+       ServicePtrs[(i)]->bInheritACLS = true;
+}