ipaldap: merge external_bind into LDAPClient

* Rename do_external_bind to external_bind
* Remove user_name argument in  external_bind() and always set it
    to effective user name

https://fedorahosted.org/freeipa/ticket/6461

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Tomas Krizek authored and Martin Basti committed 2016-11-07 11:34:03 +01:00
1 parent de58a5c605
commit 60e38ecc7f
10 files changed
+15 -25

No files matched your search

+1 -4
View File
@@ -28,7 +28,6 @@ Backend plugin for LDAP.
# everything except the CrudBackend methods, where dn is part of the entry dict.
import os
import pwd
import ldap as _ldap
@@ -181,9 +180,7 @@ class ldap2(CrudBackend, LDAPClient):
client_controls=clientctrls)
elif autobind != AUTOBIND_DISABLED and os.getegid() == 0 and ldapi:
try:
pw_name = pwd.getpwuid(os.geteuid()).pw_name
client.external_bind(pw_name,
server_controls=serverctrls,
client.external_bind(server_controls=serverctrls,
client_controls=clientctrls)
except errors.NotFound:
if autobind == AUTOBIND_ENABLED: