# 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(Attrs) > 0: # only if we are still good to go
try:
Res = FinishConfirmSudopassword(l, GetAttr(DnRecord,"uid"), Attrs)
if not Res is None:
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);