summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-01-10 15:12:00 +0100
committerStefan Metzmacher <metze@samba.org>2012-01-12 22:12:41 +0100
commit9a8b72a3180b6aa1beb4b153867d4f9f0df953a1 (patch)
tree023c7d0c2a0eda166664156d960e34a6d1b7b017 /source4/scripting
parent103c1cb9bf71af1925feb07386a6920807aceca3 (diff)
downloadsamba-9a8b72a3180b6aa1beb4b153867d4f9f0df953a1.tar.gz
samba-9a8b72a3180b6aa1beb4b153867d4f9f0df953a1.tar.bz2
samba-9a8b72a3180b6aa1beb4b153867d4f9f0df953a1.zip
s4:repl_cleartext_pwd.py: correctly compare attids as uint32_t values
metze
Diffstat (limited to 'source4/scripting')
-rwxr-xr-xsource4/scripting/devel/repl_cleartext_pwd.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/source4/scripting/devel/repl_cleartext_pwd.py b/source4/scripting/devel/repl_cleartext_pwd.py
index ac650d95d0..576f4b85f1 100755
--- a/source4/scripting/devel/repl_cleartext_pwd.py
+++ b/source4/scripting/devel/repl_cleartext_pwd.py
@@ -71,6 +71,9 @@ class globals:
continue
self.global_objs = {}
+def attid_equal(a1,a2):
+ return (a1 & 0xffffffff) == (a2 & 0xffffffff)
+
########### main code ###########
if __name__ == "__main__":
parser = OptionParser("repl_cleartext_pwd.py [options] server dn cookie_file cleartext_name [attid attname]")
@@ -90,7 +93,10 @@ if __name__ == "__main__":
cookie_file = None
cleartext_name = args[3]
if len(args) >= 5:
- attid = int(args[4])
+ try:
+ attid = int(args[4], 16)
+ except:
+ attid = int(args[4])
attname = args[5]
else:
attid = -1
@@ -232,7 +238,7 @@ if __name__ == "__main__":
is_deleted = False
for i in range(0, obj.attribute_ctr.num_attributes):
attr = obj.attribute_ctr.attributes[i]
- if attr.attid == drsuapi.DRSUAPI_ATTID_isDeleted:
+ if attid_equal(attr.attid, drsuapi.DRSUAPI_ATTID_isDeleted):
is_deleted = True
if is_deleted:
obj_item = obj_item.next_object
@@ -242,19 +248,18 @@ if __name__ == "__main__":
attvals = None
for i in range(0, obj.attribute_ctr.num_attributes):
attr = obj.attribute_ctr.attributes[i]
- if attr.attid == attid:
+ if attid_equal(attr.attid, attid):
attvals = []
for j in range(0, attr.value_ctr.num_values):
assert attr.value_ctr.values[j].blob is not None
attvals.append(attr.value_ctr.values[j].blob)
- if attr.attid != drsuapi.DRSUAPI_ATTID_supplementalCredentials:
+ if not attid_equal(attr.attid, drsuapi.DRSUAPI_ATTID_supplementalCredentials):
continue
assert attr.value_ctr.num_values <= 1
if attr.value_ctr.num_values == 0:
break
assert attr.value_ctr.values[0].blob is not None
spl_crypt = attr.value_ctr.values[0].blob
- break
if spl_crypt is None:
obj_item = obj_item.next_object