From c29a8c7ec55b6961a51f52bf75671f7af8abf2df Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Mon, 15 Nov 2010 07:41:59 +0200 Subject: s4-samdb.py: Use ldb.get_default_basedn() to avoid RootDSE search --- source4/scripting/python/samba/samdb.py | 7 +------ 1 file changed, 1 insertion(+), 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 -- cgit