From: Stefan Metzmacher Date: Tue, 28 May 2019 12:53:09 +0000 (+0200) Subject: samba-tool: fix replication after dns partition fsmo role transfer X-Git-Tag: samba-4.9.12~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b9d7481fe8bc365e0e5d7549f1845724130eaa9;p=thirdparty%2Fsamba.git samba-tool: fix replication after dns partition fsmo role transfer The new role owner need to replicate from the old role owner. Before we told the old role owner to replicate from itself. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13973 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett (cherry picked from commit 4793f8ed584a4e6d8a26b06b691ec636e77d8f2a) --- diff --git a/python/samba/netcmd/fsmo.py b/python/samba/netcmd/fsmo.py index 91de5dad563..c276f5fced7 100644 --- a/python/samba/netcmd/fsmo.py +++ b/python/samba/netcmd/fsmo.py @@ -64,6 +64,8 @@ def transfer_dns_role(outf, sambaopts, credopts, role, samdb): forest_dn = samba.dn_from_dns_name(samdb.forest_dns_name()) role_object = "CN=Infrastructure,DC=ForestDnsZones," + forest_dn + new_host_dns_name = samdb.host_dns_name() + res = samdb.search(role_object, attrs=["fSMORoleOwner"], scope=ldb.SCOPE_BASE, @@ -128,7 +130,7 @@ def transfer_dns_role(outf, sambaopts, credopts, role, samdb): raise CommandError("Failed to add role '%s': %s" % (role, msg)) try: - connection = samba.drs_utils.drsuapi_connect(samdb.host_dns_name(), + connection = samba.drs_utils.drsuapi_connect(new_host_dns_name, lp, creds) except samba.drs_utils.drsException as e: raise CommandError("Drsuapi Connect failed", e) diff --git a/selftest/knownfail.d/fsmo b/selftest/knownfail.d/fsmo deleted file mode 100644 index da665d2251d..00000000000 --- a/selftest/knownfail.d/fsmo +++ /dev/null @@ -1,2 +0,0 @@ -^samba4.drs.fsmo.python.*.fsmo.DrsFsmoTestCase.test_DomainDnsZonesMasterTransfer -^samba4.drs.fsmo.python.*.fsmo.DrsFsmoTestCase.test_ForestDnsZonesMasterTransfer