]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/cache.c
Import resetting of c_dn/c_cdn after anonymous bind.
[openldap] / servers / slapd / back-ldbm / cache.c
index f8664f5ebe2b0c133601ed25314d6f838ca4380d..a9c31cc3eb68bff427e6c6193ef39255228d6610 100644 (file)
@@ -3,9 +3,10 @@
 #include "portable.h"
 
 #include <stdio.h>
-int strcasecmp( const char *, const char *);
 
+#include <ac/string.h>
 #include <ac/socket.h>
+
 #include "slap.h"
 
 #include "back-ldbm.h"
@@ -35,8 +36,8 @@ cache_entry_cmp( Entry *e1, Entry *e2 )
 static int
 cache_entrydn_cmp( Entry *e1, Entry *e2 )
 {
-       /* compare their normalized dn's */
-       return( strcasecmp( e1->e_ndn, e2->e_ndn ) );
+       /* compare their normalized UPPERCASED dn's */
+       return( strcmp( e1->e_ndn, e2->e_ndn ) );
 }
 
 static int
@@ -235,7 +236,7 @@ cache_find_entry_dn2id(
        pthread_mutex_lock( &cache->c_mutex );
 
        e.e_dn = dn;
-       e.e_ndn = dn_normalize( ch_strdup( dn ) );
+       e.e_ndn = dn_normalize_case( ch_strdup( dn ) );
 
        if ( (ep = (Entry *) avl_find( cache->c_dntree, (caddr_t) &e,
                cache_entrydn_cmp )) != NULL )