]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Update the DN information associated with each LDAP connection after util_ldap_cache_...
authorBradley Nicholes <bnicholes@apache.org>
Wed, 31 Mar 2004 22:56:08 +0000 (22:56 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Wed, 31 Mar 2004 22:56:08 +0000 (22:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103225 13f79535-47bb-0310-9956-ffa450edef68

modules/experimental/util_ldap.c

index 6746d74a7ce979f4591d50717a74613e8c3710f3..54648e50a1422ce57c995c70a2e5dc3b3ccd45d0 100644 (file)
@@ -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.