mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
samba-tool:provision: fix bug 11600
If you join a second DC after changing the name of the 'Default Domain Policy' or 'Default Domain Controllers Policy' the join will fail as the search is hardcoded to these names, this fix changes the search to the objects name. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11600 Signed-off-by: Rowland Penny <repenny241155@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Sat Nov 21 04:44:58 CET 2015 on sn-devel-104
This commit is contained in:
parent
8fdda6fa96
commit
0111773310
@ -276,16 +276,15 @@ def find_provision_key_parameters(samdb, secretsdb, idmapdb, paths, smbconf,
|
||||
names.domainlevel = int(res6[0]["msDS-Behavior-Version"][0])
|
||||
|
||||
# policy guid
|
||||
res7 = samdb.search(expression="(displayName=Default Domain Policy)",
|
||||
res7 = samdb.search(expression="(name={%s})" % DEFAULT_POLICY_GUID,
|
||||
base="CN=Policies,CN=System," + basedn,
|
||||
scope=ldb.SCOPE_ONELEVEL, attrs=["cn","displayName"])
|
||||
names.policyid = str(res7[0]["cn"]).replace("{","").replace("}","")
|
||||
# dc policy guid
|
||||
res8 = samdb.search(expression="(displayName=Default Domain Controllers"
|
||||
" Policy)",
|
||||
base="CN=Policies,CN=System," + basedn,
|
||||
scope=ldb.SCOPE_ONELEVEL,
|
||||
attrs=["cn","displayName"])
|
||||
res8 = samdb.search(expression="(name={%s})" % DEFAULT_DC_POLICY_GUID,
|
||||
base="CN=Policies,CN=System," + basedn,
|
||||
scope=ldb.SCOPE_ONELEVEL,
|
||||
attrs=["cn","displayName"])
|
||||
if len(res8) == 1:
|
||||
names.policyid_dc = str(res8[0]["cn"]).replace("{","").replace("}","")
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user