summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-04-16 19:01:15 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-04-18 05:39:01 +0200
commit538893d183e967448df5aeb41b99a8af5116c5b7 (patch)
treeadab6cb9c906f37e8af056df06f63552bdfa2781
parent628a24172f3bb759324582c439ba9d081aa4d392 (diff)
downloadsamba-538893d183e967448df5aeb41b99a8af5116c5b7.tar.gz
samba-538893d183e967448df5aeb41b99a8af5116c5b7.tar.bz2
samba-538893d183e967448df5aeb41b99a8af5116c5b7.zip
s3fs: Use xattr_tdb format for xattr storage
Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed Apr 18 05:39:01 CEST 2012 on sn-devel-104
-rw-r--r--file_server/file_server.c6
-rw-r--r--selftest/target/Samba4.pm2
-rw-r--r--source4/scripting/python/samba/provision/__init__.py25
3 files changed, 21 insertions, 12 deletions
diff --git a/file_server/file_server.c b/file_server/file_server.c
index d3eb53c9a2..ad05fca7d1 100644
--- a/file_server/file_server.c
+++ b/file_server/file_server.c
@@ -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");
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index bc94d7c86c..bc469d7d57 100644
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -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...";
diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py
index 6bb09b7fe9..04cafa9c97 100644
--- a/source4/scripting/python/samba/provision/__init__.py
+++ b/source4/scripting/python/samba/provision/__init__.py
@@ -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()