file_server: Move default VFS module settings to loadparm.c
authorAndrew Bartlett <abartlet@samba.org>
Wed, 22 Aug 2012 13:34:24 +0000 (23:34 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 23 Aug 2012 13:02:26 +0000 (15:02 +0200)
This means that any utility that calls into the VFS layer will get the
right modules.

Because we use the fake_acls backend we need to override this whole
list in Samba4.pm however.

Andrew Bartlett

file_server/file_server.c
selftest/target/Samba4.pm
source3/param/loadparm.c

index 2b9e48a38bbba7c5552ba9310a58e69c55788dfa..448894ecbdaf5a875f471e1718ffe49b8d2f1cca 100644 (file)
@@ -61,15 +61,6 @@ static const char *generate_smb_conf(struct task_server *task)
        fdprintf(fd, "rpc_daemon:spoolssd = disabled\n");
        fdprintf(fd, "rpc_server:tcpip = no\n");
 
-       /* If we are using xattr_tdb:file or posix:eadb then we need to load another VFS object */
-       if (lpcfg_parm_string(lp_ctx, NULL, "xattr_tdb", "file")) {
-               fdprintf(fd, "vfs objects = acl_xattr xattr_tdb\n");
-       } else if (lpcfg_parm_string(lp_ctx, NULL, "posix", "eadb")) {
-               fdprintf(fd, "vfs objects = acl_xattr posix_eadb\n");
-       } else {
-               fdprintf(fd, "vfs objects = acl_xattr\n");
-       }
-
        fdprintf(fd, "map hidden = no\n");
        fdprintf(fd, "map system = no\n");
        fdprintf(fd, "map readonly = no\n");
@@ -77,9 +68,6 @@ static const char *generate_smb_conf(struct task_server *task)
 
        fdprintf(fd, "include = %s\n", lpcfg_configfile(lp_ctx));
 
-       fdprintf(fd, "[IPC$]\n");
-       fdprintf(fd, " vfs objects = dfs_samba4\n");
-
        close(fd);
        return path;
 }
index 4b6af336b7827485aab96e6ed2e627b6928acc31..248a7259f780d9230aab76b8bf939994d0940431 100644 (file)
@@ -1367,7 +1367,7 @@ sub provision_plugin_s4_dc($$)
        create mask = 755
        dos filemode = yes
 
-        vfs objects = acl_xattr fake_acls xattr_tdb streams_depot
+        vfs objects = dfs_samba4 acl_xattr fake_acls xattr_tdb streams_depot
 
         dcerpc endpoint servers = -winreg -srvsvc
 
index 0b5a0e87f01a56ea8d90625267133c940e401bc2..d9ce4b4b5840047ba57881b9b811474dbcebe805 100644 (file)
@@ -4902,6 +4902,19 @@ static bool lp_load_ex(const char *pszFname,
 
        fault_configure(smb_panic_s3);
 
+       if (lp_server_role() == ROLE_ACTIVE_DIRECTORY_DC) {
+               const char **vfs_objects = lp_vfs_objects(-1);
+               if (!vfs_objects || !vfs_objects[0]) {
+                       if (lp_parm_const_string(-1, "xattr_tdb", "file", NULL)) {
+                               lp_do_parameter(-1, "vfs objects", "dfs_samba4 acl_xattr xattr_tdb");
+                       } else if (lp_parm_const_string(-1, "posix", "eadb", NULL)) {
+                               lp_do_parameter(-1, "vfs objects", "dfs_samba4 acl_xattr posix_eadb");
+                       } else {
+                               lp_do_parameter(-1, "vfs objects", "dfs_samba4 acl_xattr");
+                       }
+               }
+       }
+
        bAllowIncludeRegistry = true;
 
        return (bRetval);