summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/scripting/python/samba/samba3/__init__.py8
-rw-r--r--source4/scripting/python/samba/upgrade.py2
2 files changed, 8 insertions, 2 deletions
diff --git a/source4/scripting/python/samba/samba3/__init__.py b/source4/scripting/python/samba/samba3/__init__.py
index f5dde44aa0..385d9331ec 100644
--- a/source4/scripting/python/samba/samba3/__init__.py
+++ b/source4/scripting/python/samba/samba3/__init__.py
@@ -754,12 +754,18 @@ class Samba3(object):
self.libdir = libdir
self.lp = ParamFile()
self.lp.read(self.smbconfpath)
+ self.privatedir = self.lp.get("private dir") or libdir
def libdir_path(self, path):
if path[0] == "/" or path[0] == ".":
return path
return os.path.join(self.libdir, path)
+ def privatedir_path(self, path):
+ if path[0] == "/" or path[0] == ".":
+ return path
+ return os.path.join(self.privatedir, path)
+
def get_conf(self):
return self.lp
@@ -789,7 +795,7 @@ class Samba3(object):
return Registry(self.libdir_path("registry.tdb"))
def get_secrets_db(self):
- return SecretsDatabase(self.libdir_path("secrets.tdb"))
+ return SecretsDatabase(self.privatedir_path("secrets.tdb"))
def get_shareinfo_db(self):
return ShareInfoDatabase(self.libdir_path("share_info.tdb"))
diff --git a/source4/scripting/python/samba/upgrade.py b/source4/scripting/python/samba/upgrade.py
index 38e6ed87bb..6226681830 100644
--- a/source4/scripting/python/samba/upgrade.py
+++ b/source4/scripting/python/samba/upgrade.py
@@ -535,7 +535,7 @@ def upgrade_from_samba3(samba3, logger, session_info, smbconf, targetdir):
# We must close the direct pytdb database before the C code loads it
secrets_db.close()
- passdb.set_secrets_dir(samba3.libdir)
+ passdb.set_secrets_dir(samba3.privatedir)
# Get domain sid
try: