]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_ldap calls ldap_simple_bind_s() to validate the user
authorGraham Leggett <minfrin@apache.org>
Fri, 21 May 2004 20:02:39 +0000 (20:02 +0000)
committerGraham Leggett <minfrin@apache.org>
Fri, 21 May 2004 20:02:39 +0000 (20:02 +0000)
credentials.  If the bind fails, the connection is left
in an unbound state.  Make sure that the ldap connection
record is updated to show that the connection is no longer
bound.
PR:
Obtained from:
Submitted by:
Reviewed by: bnicholes, minfrin, jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@103721 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/experimental/util_ldap.c

diff --git a/CHANGES b/CHANGES
index beda433892750e9f682a1d639165f1129b3dfdfc..28459992fe03ae2cb4b132880f3ca0c46a42922e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,11 @@
 Changes with Apache 2.0.50
 
+  *) mod_ldap calls ldap_simple_bind_s() to validate the user
+     credentials.  If the bind fails, the connection is left
+     in an unbound state.  Make sure that the ldap connection
+     record is updated to show that the connection is no longer
+     bound. [Brad Nicholes]
+
   *) Ensure that lines in the request which are too long are 
      properly terminated before logging.
      [Tsurutani Naoki <turutani scphys.kyoto-u.ac.jp>]
diff --git a/STATUS b/STATUS
index ec72cefdc5362602ded781a6d30c3c48ca5960f4..1983126f75759c0c6a9ab5e49f1d3df7618fee8a 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2004/05/21 16:07:39 $]
+Last modified at [$Date: 2004/05/21 20:02:20 $]
 
 Release:
 
@@ -123,15 +123,6 @@ PATCHES TO BACKPORT FROM 2.1
        PR: 13511
        +1: jorton
 
-    *) mod_ldap calls ldap_simple_bind_s() to validate the user
-       credentials.  If the bind fails, the connection is left
-       in an unbound state.  Make sure that the ldap connection
-       record is updated to show that the connection is no longer
-       bound.
-       modules/experimental/util_ldap.c: r1.27
-       +1: bnicholes, jim
-       +1: minfrin (confirmed fixes long standing timeout bug)
-        
     *) mod_ssl: Fix potential SEGV in 'shmcb' session cache.
        modules/ssl/ssl_scache_shmcb.c: r1.26
        +1: madhum, jorton
index 70dcf06919e6dab9cdc7d14a7bbf36fe03b5fff8..16b1ebae42131d3d465547a73fa659b97bf93e97 100644 (file)
@@ -333,9 +333,6 @@ LDAP_DECLARE(int) util_ldap_connection_open(request_rec *r,
             break;
     }
 
-    ldc->bound = 1;
-    ldc->reason = "LDAP: connection open successful";
-
     /* free the handle if there was an error
     */
     if (LDAP_SUCCESS != result)
@@ -345,6 +342,10 @@ LDAP_DECLARE(int) util_ldap_connection_open(request_rec *r,
         ldc->bound = 0;
         ldc->reason = "LDAP: ldap_simple_bind_s() failed";
     }
+       else {
+               ldc->bound = 1;
+               ldc->reason = "LDAP: connection open successful";
+       }
 
     return(result);
 }
@@ -875,6 +876,9 @@ start_over:
     if (result != LDAP_SUCCESS) {
         ldc->reason = "ldap_simple_bind_s() to check user credentials failed";
         ldap_msgfree(res);
+        ldap_unbind_s(ldc->ldap);
+        ldc->ldap = NULL;
+        ldc->bound = 0;
         return result;
     }
     else {