We check for the default base DN as this does require authentication, but
we do not need to search for more than just that (so use SCOPE_BASE) and
we need no attributes, so ask for none
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
ctx.site = DEFAULTSITE
try:
- ctx.samdb.search(scope=ldb.SCOPE_ONELEVEL, attrs=["dn"])
- except ldb.LdbError as e4:
- (enum, estr) = e4.args
+ ctx.samdb.search(scope=ldb.SCOPE_BASE, attrs=[])
+ except ldb.LdbError as e:
+ (enum, estr) = e.args
raise DCJoinException(estr)
ctx.base_dn = str(ctx.samdb.get_default_basedn())