1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-14 12:59:07 +03:00

s4-samdb.py: Use ldb.get_default_basedn() to avoid RootDSE search

This commit is contained in:
Kamen Mazdrashki
2010-11-15 07:41:59 +02:00
parent b4809e4a82
commit c29a8c7ec5

View File

@ -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