mirror of
https://github.com/samba-team/samba.git
synced 2025-01-22 22:04:08 +03:00
samba-tool: use only one LDAP modify for dns partition fsmo role transfer
We should not risk that we end with no role owner. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13973 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 6a2e3a15585086bcceb18283216978a2fcb30da3)
This commit is contained in:
parent
4d7ce477eb
commit
7788b9f303
@ -108,20 +108,10 @@ def transfer_dns_role(outf, sambaopts, credopts, role, samdb):
|
||||
|
||||
m = ldb.Message()
|
||||
m.dn = ldb.Dn(samdb, role_object)
|
||||
m["fSMORoleOwner"] = ldb.MessageElement(master_owner,
|
||||
m["fSMORoleOwner_Del"] = ldb.MessageElement(master_owner,
|
||||
ldb.FLAG_MOD_DELETE,
|
||||
"fSMORoleOwner")
|
||||
|
||||
try:
|
||||
samdb.modify(m)
|
||||
except LdbError as e4:
|
||||
(num, msg) = e4.args
|
||||
raise CommandError("Failed to delete role '%s': %s" %
|
||||
(role, msg))
|
||||
|
||||
m = ldb.Message()
|
||||
m.dn = ldb.Dn(samdb, role_object)
|
||||
m["fSMORoleOwner"] = ldb.MessageElement(new_owner,
|
||||
m["fSMORoleOwner_Add"] = ldb.MessageElement(new_owner,
|
||||
ldb.FLAG_MOD_ADD,
|
||||
"fSMORoleOwner")
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user