s3fs: Use xattr_tdb format for xattr storage
authorAndrew Bartlett <abartlet@samba.org>
Mon, 16 Apr 2012 09:01:15 +0000 (19:01 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 18 Apr 2012 03:39:01 +0000 (05:39 +0200)
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Apr 18 05:39:01 CEST 2012 on sn-devel-104

file_server/file_server.c
selftest/target/Samba4.pm
source4/scripting/python/samba/provision/__init__.py

index d3eb53c..ad05fca 100644 (file)
@@ -57,8 +57,10 @@ 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 posix:eadb then we need to load another VFS object */
-       if (lpcfg_parm_string(lp_ctx, NULL, "posix", "eadb")) {
+       /* 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");
index bc94d7c..bc469d7 100644 (file)
@@ -1268,7 +1268,7 @@ sub provision_plugin_s4_dc($$)
        my $extra_smbconf_options = "
 server services = -smb +s3fs
 dcerpc endpoint servers = -unixinfo -spoolss -winreg -wkssvc -srvsvc
-
+xattr_tdb:file = $prefix/statedir/xattr.tdb
 ";
 
        print "PROVISIONING PLUGIN S4 DC...";
index 6bb09b7..04cafa9 100644 (file)
@@ -587,7 +587,7 @@ def guess_names(lp=None, hostname=None, domain=None, dnsdomain=None,
 
 
 def make_smbconf(smbconf, hostname, domain, realm, targetdir,
-                 serverrole=None, sid_generator=None, eadb=False, lp=None,
+                 serverrole=None, sid_generator=None, eadb=False, use_ntvfs=False, lp=None,
                  global_param=None):
     """Create a new smb.conf file based on a couple of basic settings.
     """
@@ -623,12 +623,19 @@ def make_smbconf(smbconf, hostname, domain, realm, targetdir,
     #Load non-existant file
     if os.path.exists(smbconf):
         lp.load(smbconf)
-    if eadb and not lp.get("posix:eadb"):
-        if targetdir is not None:
-            privdir = os.path.join(targetdir, "private")
-        else:
-            privdir = lp.get("private dir")
-        lp.set("posix:eadb", os.path.abspath(os.path.join(privdir, "eadb.tdb")))
+    if eadb:
+        if use_ntvfs and not lp.get("posix:eadb"):
+            if targetdir is not None:
+                privdir = os.path.join(targetdir, "private")
+            else:
+                privdir = lp.get("private dir")
+            lp.set("posix:eadb", os.path.abspath(os.path.join(privdir, "eadb.tdb")))
+        elif not use_ntvfs and not lp.get("xattr_tdb:file"):
+            if targetdir is not None:
+                statedir = os.path.join(targetdir, "state")
+            else:
+                statedir = lp.get("state dir")
+            lp.set("xattr_tdb:file", os.path.abspath(os.path.join(statedir, "xattr.tdb")))
 
     if global_param is not None:
         for ent in global_param:
@@ -1665,12 +1672,12 @@ def provision(logger, session_info, credentials, smbconf=None,
         if data is None or data == "":
             make_smbconf(smbconf, hostname, domain, realm,
                          targetdir, serverrole=serverrole,
-                         sid_generator=sid_generator, eadb=useeadb,
+                         sid_generator=sid_generator, eadb=useeadb, use_ntvfs=use_ntvfs,
                          lp=lp, global_param=global_param)
     else:
         make_smbconf(smbconf, hostname, domain, realm, targetdir,
                      serverrole=serverrole, sid_generator=sid_generator,
-                     eadb=useeadb, lp=lp, global_param=global_param)
+                     eadb=useeadb, use_ntvfs=use_ntvfs, lp=lp, global_param=global_param)
 
     if lp is None:
         lp = samba.param.LoadParm()