Skip to content

Commit

Permalink
s3fs: Use xattr_tdb format for xattr storage
Browse files Browse the repository at this point in the history
Autobuild-User: Andrew Bartlett <[email protected]>
Autobuild-Date: Wed Apr 18 05:39:01 CEST 2012 on sn-devel-104
  • Loading branch information
abartlet committed Apr 18, 2012
1 parent 628a241 commit 538893d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
6 changes: 4 additions & 2 deletions file_server/file_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion selftest/target/Samba4.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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...";
Expand Down
25 changes: 16 additions & 9 deletions source4/scripting/python/samba/provision/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 538893d

Please sign in to comment.