diff options
author | Matthieu Patou <mat@matws.net> | 2010-09-26 04:57:04 +0400 |
---|---|---|
committer | Matthieu Patou <mat@matws.net> | 2010-09-26 06:22:43 +0400 |
commit | 873bd989049e4953afb478ca5518984b26870326 (patch) | |
tree | 197aaacb4b72e3d232f0fc4599359d7b7878b658 | |
parent | 43274c9071ec357fe629fdfa7966a772d1844188 (diff) | |
download | samba-873bd989049e4953afb478ca5518984b26870326.tar.gz samba-873bd989049e4953afb478ca5518984b26870326.tar.bz2 samba-873bd989049e4953afb478ca5518984b26870326.zip |
upgradeprovision: Fix a bug with renamed entries
The SD was not refetched for renamed entries, resulting with a try to
add an additional SD when there was already one.
-rwxr-xr-x | source4/scripting/bin/upgradeprovision | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision index de0ad5e3e7..68d84a970d 100755 --- a/source4/scripting/bin/upgradeprovision +++ b/source4/scripting/bin/upgradeprovision @@ -813,7 +813,7 @@ def update_present(ref_samdb, samdb, basedn, listPresent, usns, invocationid): identic_rename(samdb, reference[0].dn) current = samdb.search(expression="dn=%s" % (str(dn)), base=basedn, scope=SCOPE_SUBTREE, - controls=["search_options:1:2"]) + controls=controls) delta = samdb.msg_diff(current[0], reference[0]) @@ -897,7 +897,18 @@ def update_present(ref_samdb, samdb, basedn, listPresent, usns, invocationid): if attrUSN is None: delta.remove(att) continue - + if att == "nTSecurityDescriptor": + cursd = ndr_unpack(security.descriptor, + str(current[0]["nTSecurityDescriptor"])) + cursddl = cursd.as_sddl(names.domainsid) + refsd = ndr_unpack(security.descriptor, + str(reference[0]["nTSecurityDescriptor"])) + refsddl = cursd.as_sddl(names.domainsid) + + if get_diff_sddls(refsddl, cursddl) == "": + message(CHANGE, "sd are identical") + else: + message(CHANGE, "sd are not identical") if attrUSN == -1: # This attribute was last modified by another DC forget # about it |