From b281fc624e53ead0ef614ea2fcff46bc9b599f92 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 25 Jun 2019 16:12:47 +1200 Subject: provision: If --targetdir has been specified then we must always reset posix:eadb and xattr_tdb:file This is required because otherwise this may have been set previously by another part of selftest thanks to the global loadparm and the running of multiple samba-tool tests within the same python process. Signed-off-by: Andrew Bartlett Reviewed-by: Gary Lockyer --- python/samba/provision/__init__.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'python') diff --git a/python/samba/provision/__init__.py b/python/samba/provision/__init__.py index d78222845ba..ffca9f2aab5 100644 --- a/python/samba/provision/__init__.py +++ b/python/samba/provision/__init__.py @@ -774,18 +774,24 @@ def make_smbconf(smbconf, hostname, domain, realm, targetdir, lp.set("binddns dir", global_settings["binddns dir"]) if eadb: - if use_ntvfs and not lp.get("posix:eadb"): + if use_ntvfs: if targetdir is not None: privdir = os.path.join(targetdir, "private") - else: + lp.set("posix:eadb", + os.path.abspath(os.path.join(privdir, "eadb.tdb"))) + elif not lp.get("posix:eadb"): 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"): + lp.set("posix:eadb", + os.path.abspath(os.path.join(privdir, "eadb.tdb"))) + else: if targetdir is not None: statedir = os.path.join(targetdir, "state") - else: + lp.set("xattr_tdb:file", + os.path.abspath(os.path.join(statedir, "xattr.tdb"))) + elif not lp.get("xattr_tdb:file"): statedir = lp.get("state directory") - lp.set("xattr_tdb:file", os.path.abspath(os.path.join(statedir, "xattr.tdb"))) + lp.set("xattr_tdb:file", + os.path.abspath(os.path.join(statedir, "xattr.tdb"))) shares = {} if serverrole == "active directory domain controller": -- cgit v1.2.1