diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-08-05 13:09:35 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-08-09 11:56:23 +0200 |
commit | 4e4953dd48467cf96a17cc48ccf1139e175845fe (patch) | |
tree | 309b259a96b6d475492070c5498214ecbcd9eb31 /source4 | |
parent | 8ce8107a5bcd821585138fd6e7c690547b783bbf (diff) | |
download | samba-4e4953dd48467cf96a17cc48ccf1139e175845fe.tar.gz samba-4e4953dd48467cf96a17cc48ccf1139e175845fe.tar.bz2 samba-4e4953dd48467cf96a17cc48ccf1139e175845fe.zip |
s4-samdb: support relative paths in SamDB() connect
don't add the private path unless the database doesn't exist with the
supplied path
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/python/samba/samdb.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py index 46a7fea32e..70f73da6f4 100644 --- a/source4/scripting/python/samba/samdb.py +++ b/source4/scripting/python/samba/samdb.py @@ -27,6 +27,7 @@ import samba import ldb import time import base64 +import os from samba import dsdb from samba.ndr import ndr_unpack, ndr_pack from samba.dcerpc import drsblobs, misc @@ -62,7 +63,7 @@ class SamDB(samba.Ldb): dsdb._dsdb_set_am_rodc(self, am_rodc) def connect(self, url=None, flags=0, options=None): - if self.lp is not None: + if self.lp is not None and not os.path.exists(url): url = self.lp.private_path(url) self.url = url |