mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add a raiseonerr option to ldappasswd_user_change
This is so on tests for bad password one can catch the error message. https://pagure.io/freeipa/issue/6964 https://pagure.io/freeipa/issue/5948 https://pagure.io/freeipa/issue/2445 https://pagure.io/freeipa/issue/298 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
parent
6da070e655
commit
be2efc12d3
@ -1751,7 +1751,8 @@ def get_host_ip_with_hostmask(host):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def ldappasswd_user_change(user, oldpw, newpw, master, use_dirman=False):
|
def ldappasswd_user_change(user, oldpw, newpw, master, use_dirman=False,
|
||||||
|
raiseonerr=True):
|
||||||
container_user = dict(DEFAULT_CONFIG)['container_user']
|
container_user = dict(DEFAULT_CONFIG)['container_user']
|
||||||
basedn = master.domain.basedn
|
basedn = master.domain.basedn
|
||||||
|
|
||||||
@ -1766,7 +1767,7 @@ def ldappasswd_user_change(user, oldpw, newpw, master, use_dirman=False):
|
|||||||
else:
|
else:
|
||||||
args = [paths.LDAPPASSWD, '-D', userdn, '-w', oldpw, '-a', oldpw,
|
args = [paths.LDAPPASSWD, '-D', userdn, '-w', oldpw, '-a', oldpw,
|
||||||
'-s', newpw, '-x', '-ZZ', '-H', master_ldap_uri]
|
'-s', newpw, '-x', '-ZZ', '-H', master_ldap_uri]
|
||||||
master.run_command(args)
|
return master.run_command(args, raiseonerr=raiseonerr)
|
||||||
|
|
||||||
|
|
||||||
def ldappasswd_sysaccount_change(user, oldpw, newpw, master, use_dirman=False):
|
def ldappasswd_sysaccount_change(user, oldpw, newpw, master, use_dirman=False):
|
||||||
|
Loading…
Reference in New Issue
Block a user