From 7a639b895594579ed232fa99bbcd1c4767a76316 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 31 Mar 2004 22:56:08 +0000 Subject: [PATCH] Update the DN information associated with each LDAP connection after util_ldap_cache_checkuserid() rebinds the connection. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103225 13f79535-47bb-0310-9956-ffa450edef68 --- modules/experimental/util_ldap.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/experimental/util_ldap.c b/modules/experimental/util_ldap.c index 6746d74a7c..54648e50a1 100644 --- a/modules/experimental/util_ldap.c +++ b/modules/experimental/util_ldap.c @@ -844,6 +844,18 @@ start_over: ldap_msgfree(res); return result; } + else { + /* + * Since we just bound the connection to the authenticating user id, update the + * ldc->binddn and ldc->bindpw to reflect the change and also to allow the next + * call to util_ldap_connection_open() to handle the connection reuse appropriately. + * Otherwise the next time that this connection is reused, it will indicate that + * it is bound to the original user id specified ldc->binddn when in fact it is + * bound to a completely different user id. + */ + ldc->binddn = apr_pstrdup(st->pool, *binddn); + ldc->bindpw = apr_pstrdup(st->pool, bindpw); + } /* * Get values for the provided attributes. -- 2.40.0