X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-mailgate;h=2aae92b55347a03ff977afd9516a7c7a2c69eca1;hb=b13771828d0938c805b3824bd2c7162933946ad3;hp=1ec0e9f503047b2eca2a8a96c151c71f379fb217;hpb=703033b7eeaffc61568300877d2d452651388acf;p=mirror%2Fuserdir-ldap.git diff --git a/ud-mailgate b/ud-mailgate index 1ec0e9f..2aae92b 100755 --- a/ud-mailgate +++ b/ud-mailgate @@ -615,7 +615,7 @@ def HandleChange(Reply,DnRecord,Key): # Connect to the ldap server l = connect_to_ldap_and_check_if_locked(DnRecord) - if CommitChanges == 1: # only if we are still good to go + if CommitChanges == 1 and len(SudoPasswd) > 0: # only if we are still good to go try: Res = FinishConfirmSudopassword(l, GetAttr(DnRecord,"uid"), Attrs) if not Res is None: @@ -624,8 +624,7 @@ def HandleChange(Reply,DnRecord,Key): CommitChanges = 0 Result = Result + "FinishConfirmSudopassword raised an error (%s) - no changes committed\n"%(e); - # Modify the record - if CommitChanges == 1: + if CommitChanges == 1 and len(Attrs) > 0: Dn = "uid=" + GetAttr(DnRecord,"uid") + "," + BaseDn; l.modify_s(Dn,Attrs);