From 05f9495ff36c2335ff9c69ea408cd9328f6cc6e6 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Mon, 30 Jan 2012 17:20:28 +0100 Subject: s4:join python code - "msDS-KeyVersionNumber" does not exist on Win2k No problem since "secretsdb_self_join()" then chooses 1 as a default value. Fix case sensitivity for "msDS-KeyVersionNumber". Signed-off-by: Andrew Bartlett --- source4/scripting/python/samba/join.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py index dc09b46059..b695277db3 100644 --- a/source4/scripting/python/samba/join.py +++ b/source4/scripting/python/samba/join.py @@ -506,8 +506,12 @@ class dc_join(object): domain_name=ctx.domain_name, newpassword=ctx.acct_pass) - res = ctx.samdb.search(base=ctx.acct_dn, scope=ldb.SCOPE_BASE, attrs=["msDS-keyVersionNumber"]) - ctx.key_version_number = int(res[0]["msDS-keyVersionNumber"][0]) + res = ctx.samdb.search(base=ctx.acct_dn, scope=ldb.SCOPE_BASE, + attrs=["msDS-KeyVersionNumber"]) + if "msDS-KeyVersionNumber" in res[0]: + ctx.key_version_number = int(res[0]["msDS-KeyVersionNumber"][0]) + else: + ctx.key_version_number = None print("Enabling account") m = ldb.Message() -- cgit