mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
s4-samdb.py: Use ldb.get_default_basedn() to avoid RootDSE search
This commit is contained in:
@ -68,12 +68,7 @@ class SamDB(samba.Ldb):
|
|||||||
return dsdb._am_rodc(self)
|
return dsdb._am_rodc(self)
|
||||||
|
|
||||||
def domain_dn(self):
|
def domain_dn(self):
|
||||||
res = self.search(base="",
|
return str(self.get_default_basedn())
|
||||||
scope=ldb.SCOPE_BASE,
|
|
||||||
expression="(defaultNamingContext=*)",
|
|
||||||
attrs=["defaultNamingContext"])
|
|
||||||
assert(len(res) == 1 and res[0]["defaultNamingContext"] is not None)
|
|
||||||
return res[0]["defaultNamingContext"][0]
|
|
||||||
|
|
||||||
def enable_account(self, search_filter):
|
def enable_account(self, search_filter):
|
||||||
"""Enables an account
|
"""Enables an account
|
||||||
|
Reference in New Issue
Block a user