1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-05 12:22:11 +03:00

upgrade provision: change the meaning of handle_security_desc to be similar to handle_special_case

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
This commit is contained in:
Matthieu Patou
2010-02-20 10:51:25 +03:00
committed by Jelmer Vernooij
parent 5054bdb4f2
commit 2bc3631db8

View File

@ -216,14 +216,14 @@ def handle_security_desc(ischema, att, msgElt, hashallSD, old, new):
hashSD["oldSD"] = old[0][att] hashSD["oldSD"] = old[0][att]
hashSD["newSD"] = new[0][att] hashSD["newSD"] = new[0][att]
hashallSD[str(old[0].dn)] = hashSD hashallSD[str(old[0].dn)] = hashSD
return 0 return 1
if att == "nTSecurityDescriptor" and msgElt.flags() == FLAG_MOD_REPLACE: if att == "nTSecurityDescriptor" and msgElt.flags() == FLAG_MOD_REPLACE:
if ischema == 0: if ischema == 0:
hashSD = {} hashSD = {}
hashSD["oldSD"] = ndr_unpack(security.descriptor, str(old[0][att])) hashSD["oldSD"] = ndr_unpack(security.descriptor, str(old[0][att]))
hashSD["newSD"] = ndr_unpack(security.descriptor, str(new[0][att])) hashSD["newSD"] = ndr_unpack(security.descriptor, str(new[0][att]))
hashallSD[str(old[0].dn)] = hashSD hashallSD[str(old[0].dn)] = hashSD
return 1 return 0
return 0 return 0
# Handle special cases ... That's when we want to update a particular attribute # Handle special cases ... That's when we want to update a particular attribute
@ -547,7 +547,7 @@ def check_diff_name(newpaths, paths, creds, session, basedn, names, ischema):
if att == "name": if att == "name":
delta.remove(att) delta.remove(att)
continue continue
if handle_security_desc(ischema,att,msgElt,hashallSD,current,reference): if handle_security_desc(ischema,att,msgElt,hashallSD,current,reference) == 0:
delta.remove(att) delta.remove(att)
continue continue
if (not hashOverwrittenAtt.has_key(att) or not (hashOverwrittenAtt.get(att)&2^msgElt.flags())): if (not hashOverwrittenAtt.has_key(att) or not (hashOverwrittenAtt.get(att)&2^msgElt.flags())):