From 60e38ecc7ff6b983f4f3af0a66c08eb3a3fda22d Mon Sep 17 00:00:00 2001 From: Tomas Krizek Date: Thu, 6 Oct 2016 08:45:43 +0200 Subject: 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 Reviewed-By: Jan Cholasta --- ipaserver/plugins/ldap2.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'ipaserver/plugins/ldap2.py') diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py index 1b9057385..9d7c8ccdd 100644 --- a/ipaserver/plugins/ldap2.py +++ b/ipaserver/plugins/ldap2.py @@ -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: -- cgit