diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2010-11-15 07:41:59 +0200 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2010-11-18 22:28:07 +0100 |
commit | c29a8c7ec55b6961a51f52bf75671f7af8abf2df (patch) | |
tree | a8fb548de4ec1e8e24484862986259a89e70ed39 /source4/scripting | |
parent | b4809e4a8240de5faa311bf55ade3d63fd376aa5 (diff) | |
download | samba-c29a8c7ec55b6961a51f52bf75671f7af8abf2df.tar.gz samba-c29a8c7ec55b6961a51f52bf75671f7af8abf2df.tar.bz2 samba-c29a8c7ec55b6961a51f52bf75671f7af8abf2df.zip |
s4-samdb.py: Use ldb.get_default_basedn() to avoid RootDSE search
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/samba/samdb.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py index 38f018f00d..61d7c3ec80 100644 --- a/source4/scripting/python/samba/samdb.py +++ b/source4/scripting/python/samba/samdb.py @@ -68,12 +68,7 @@ class SamDB(samba.Ldb): return dsdb._am_rodc(self) def domain_dn(self): - res = self.search(base="", - scope=ldb.SCOPE_BASE, - expression="(defaultNamingContext=*)", - attrs=["defaultNamingContext"]) - assert(len(res) == 1 and res[0]["defaultNamingContext"] is not None) - return res[0]["defaultNamingContext"][0] + return str(self.get_default_basedn()) def enable_account(self, search_filter): """Enables an account |