]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/idl.c
normalize authcDN (ITS#3246); don't touch databases when running slapadd in dryryn...
[openldap] / servers / slapd / back-bdb / idl.c
index 5ecae449778deeb0684e3cbb8c3b60b00ed4e9bf..a7980a3f7abc67aec04a6d97e5f95a47b2c3c8e4 100644 (file)
@@ -27,7 +27,6 @@
 
 #define IDL_CMP(x,y)   ( x < y ? -1 : ( x > y ? 1 : 0 ) )
 
-#ifdef SLAP_IDL_CACHE
 #define IDL_LRU_DELETE( bdb, e ) do {                                  \
        if ( e->idl_lru_prev != NULL ) {                                \
                e->idl_lru_prev->idl_lru_next = e->idl_lru_next;        \
@@ -59,11 +58,10 @@ bdb_idl_entry_cmp( const void *v_idl1, const void *v_idl2 )
        const bdb_idl_cache_entry_t *idl1 = v_idl1, *idl2 = v_idl2;
        int rc;
 
-       if ((rc = idl1->db - idl2->db )) return rc;
+       if ((rc = SLAP_PTRCMP( idl1->db, idl2->db ))) return rc;
        if ((rc = idl1->kstr.bv_len - idl2->kstr.bv_len )) return rc;
        return ( memcmp ( idl1->kstr.bv_val, idl2->kstr.bv_val , idl1->kstr.bv_len ) );
 }
-#endif
 
 #if IDL_DEBUG > 0
 static void idl_check( ID *ids )
@@ -304,8 +302,6 @@ bdb_show_key(
        }
 }
 
-#ifdef SLAP_IDL_CACHE
-
 /* Find a db/key pair in the IDL cache. If ids is non-NULL,
  * copy the cached IDL into it, otherwise just return the status.
  */
@@ -444,7 +440,6 @@ bdb_idl_cache_del(
        }
        ldap_pvt_thread_rdwr_wunlock( &bdb->bi_idl_tree_rwlock );
 }
-#endif
 
 int
 bdb_idl_fetch_key(
@@ -495,12 +490,10 @@ bdb_idl_fetch_key(
 
        assert( ids != NULL );
 
-#ifdef SLAP_IDL_CACHE
        if ( bdb->bi_idl_cache_size ) {
                rc = bdb_idl_cache_get( bdb, db, key, ids );
                if ( rc != LDAP_NO_SUCH_OBJECT ) return rc;
        }
-#endif
 
        DBTzero( &data );
 
@@ -576,9 +569,7 @@ bdb_idl_fetch_key(
        }
 
        if( rc == DB_NOTFOUND ) {
-#ifndef SLAP_IDL_CACHE
                return rc;
-#endif
 
        } else if( rc != 0 ) {
 #ifdef NEW_LOGGING
@@ -619,11 +610,9 @@ bdb_idl_fetch_key(
                return -1;
        }
 
-#ifdef SLAP_IDL_CACHE
        if ( bdb->bi_idl_cache_max_size ) {
                bdb_idl_cache_put( bdb, db, key, ids, rc );
        }
-#endif
 
        return rc;
 }
@@ -659,11 +648,9 @@ bdb_idl_insert_key(
 
        assert( id != NOID );
 
-#ifdef SLAP_IDL_CACHE
        if ( bdb->bi_idl_cache_size ) {
                bdb_idl_cache_del( bdb, db, key );
        }
-#endif
 
        DBTzero( &data );
        data.size = sizeof( ID );
@@ -856,11 +843,9 @@ bdb_idl_delete_key(
        }
        assert( id != NOID );
 
-#ifdef SLAP_IDL_CACHE
        if ( bdb->bi_idl_cache_max_size ) {
                bdb_idl_cache_del( bdb, db, key );
        }
-#endif
 
        DBTzero( &data );
        data.data = &tmp;