#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"
static int
cache_entrydn_cmp( Entry *e1, Entry *e2 )
{
- return( strcasecmp( e1->e_dn, e2->e_dn ) );
+ /* compare their normalized UPPERCASED dn's */
+ return( strcmp( e1->e_ndn, e2->e_ndn ) );
}
static int
pthread_mutex_lock( &cache->c_mutex );
e.e_dn = 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 )
{
+ free(e.e_ndn);
+
Debug(LDAP_DEBUG_TRACE, "====> cache_find_entry_dn2id: found dn: %s\n",
dn, 0, 0);
return( id );
}
+ free(e.e_ndn);
+
/* free cache mutex */
pthread_mutex_unlock( &cache->c_mutex );