mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ldap: Use LDAPClient instead of IPASimpleLDAPObject in ldap2.modify_password
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
This commit is contained in:
parent
32505157ea
commit
e1f7bcfbea
@ -34,7 +34,7 @@ import krbV
|
|||||||
import ldap as _ldap
|
import ldap as _ldap
|
||||||
|
|
||||||
from ipapython.dn import DN
|
from ipapython.dn import DN
|
||||||
from ipapython.ipaldap import SASL_GSSAPI, IPASimpleLDAPObject, LDAPClient
|
from ipapython.ipaldap import SASL_GSSAPI, LDAPClient
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -471,11 +471,10 @@ class ldap2(LDAPClient, CrudBackend):
|
|||||||
pw = old_pass
|
pw = old_pass
|
||||||
if (otp):
|
if (otp):
|
||||||
pw = old_pass+otp
|
pw = old_pass+otp
|
||||||
with self.error_handler():
|
|
||||||
conn = IPASimpleLDAPObject(
|
with LDAPClient(self.ldap_uri, force_schema_updates=False) as conn:
|
||||||
self.ldap_uri, force_schema_updates=False)
|
conn.simple_bind(dn, pw)
|
||||||
conn.simple_bind_s(dn, pw)
|
conn.unbind()
|
||||||
conn.unbind_s()
|
|
||||||
|
|
||||||
with self.error_handler():
|
with self.error_handler():
|
||||||
self.conn.passwd_s(dn, old_pass, new_pass)
|
self.conn.passwd_s(dn, old_pass, new_pass)
|
||||||
|
Loading…
Reference in New Issue
Block a user