diff --git a/services/univention-s4-connector/modules/univention/s4connector/s4/password.py b/services/univention-s4-connector/modules/univention/s4connector/s4/password.py index bcddf3a235..0f50aadfa0 100644 --- a/services/univention-s4-connector/modules/univention/s4connector/s4/password.py +++ b/services/univention-s4-connector/modules/univention/s4connector/s4/password.py @@ -588,8 +588,14 @@ def password_sync_ucs_to_s4(s4connector, key, object): if unicodePwd_attr: modlist.append((ldap.MOD_DELETE, 'unicodePwd', unicodePwd_attr)) if ucsNThash: - unicodePwd_new = binascii.a2b_hex(ucsNThash) - modlist.append((ldap.MOD_ADD, 'unicodePwd', unicodePwd_new)) + try: + unicodePwd_new = binascii.a2b_hex(ucsNThash) + modlist.append((ldap.MOD_ADD, 'unicodePwd', unicodePwd_new)) + except TypeError as exc: + if ucsNThash.startswith("NO PASSWORD"): + pass + else: + raise if not ucsLMhash == s4LMhash: ud.debug(ud.LDAP, ud.INFO, "password_sync_ucs_to_s4: LM Hash S4: %s LM Hash UCS: %s" % (s4LMhash, ucsLMhash))