From e8fa25a215a9f9cacdff17b395c211f3f8fc64e1 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 26 Dec 2001 23:37:59 +0000 Subject: [PATCH] Changed Filter.f_dn to struct berval* --- servers/slapd/back-bdb/search.c | 2 +- servers/slapd/back-ldbm/dn2id.c | 12 ++++++------ servers/slapd/back-ldbm/proto-back-ldbm.h | 2 +- servers/slapd/back-ldbm/search.c | 2 +- servers/slapd/slap.h | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index 66772e42a4..4fe8393a24 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -560,7 +560,7 @@ static int search_candidates( fand.f_choice = scope == LDAP_SCOPE_SUBTREE ? SLAPD_FILTER_DN_SUBTREE : SLAPD_FILTER_DN_ONE; - fand.f_dn = e->e_ndn; + fand.f_dn = &e->e_nname; fand.f_next = xf.f_or == filter ? filter : &xf ; diff --git a/servers/slapd/back-ldbm/dn2id.c b/servers/slapd/back-ldbm/dn2id.c index 2092b46f39..14f108753b 100644 --- a/servers/slapd/back-ldbm/dn2id.c +++ b/servers/slapd/back-ldbm/dn2id.c @@ -208,7 +208,7 @@ dn2id( int dn2idl( Backend *be, - const char *dn, + struct berval *dn, int prefix, ID_BLOCK **idlp ) @@ -218,15 +218,15 @@ dn2idl( #ifdef NEW_LOGGING LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, - "dn2idl: \"%c%s\"\n", prefix, dn )); + "dn2idl: \"%c%s\"\n", prefix, dn->bv_val )); #else - Debug( LDAP_DEBUG_TRACE, "=> dn2idl( \"%c%s\" )\n", prefix, dn, 0 ); + Debug( LDAP_DEBUG_TRACE, "=> dn2idl( \"%c%s\" )\n", prefix, dn->bv_val, 0 ); #endif assert( idlp != NULL ); *idlp = NULL; - if ( prefix == DN_SUBTREE_PREFIX && be_issuffix(be, dn) ) { + if ( prefix == DN_SUBTREE_PREFIX && be_issuffix(be, dn->bv_val) ) { *idlp = ch_malloc( sizeof(ID) ); **idlp = ID_BLOCK_ALLIDS_VALUE; return 0; @@ -247,9 +247,9 @@ dn2idl( ldbm_datum_init( key ); - key.dsize = strlen( dn ) + 2; + key.dsize = dn->bv_len + 2; key.dptr = ch_malloc( key.dsize ); - sprintf( key.dptr, "%c%s", prefix, dn ); + sprintf( key.dptr, "%c%s", prefix, dn->bv_val ); *idlp = idl_fetch( be, db, key ); diff --git a/servers/slapd/back-ldbm/proto-back-ldbm.h b/servers/slapd/back-ldbm/proto-back-ldbm.h index 43a3be3015..703621932f 100644 --- a/servers/slapd/back-ldbm/proto-back-ldbm.h +++ b/servers/slapd/back-ldbm/proto-back-ldbm.h @@ -80,7 +80,7 @@ void *ldbm_cache_sync_daemon LDAP_P(( void *)); int dn2id_add LDAP_P(( Backend *be, const char *dn, ID id )); int dn2id LDAP_P(( Backend *be, const char *dn, ID *idp )); -int dn2idl LDAP_P(( Backend *be, const char *dn, int prefix, ID_BLOCK **idlp )); +int dn2idl LDAP_P(( Backend *be, struct berval *dn, int prefix, ID_BLOCK **idlp )); int dn2id_delete LDAP_P(( Backend *be, const char *dn, ID id )); Entry * dn2entry_rw LDAP_P(( Backend *be, const char *dn, Entry **matched, int rw )); diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index 89caf85928..6ba0b67afa 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -598,7 +598,7 @@ search_candidates( fand.f_choice = scope == LDAP_SCOPE_SUBTREE ? SLAPD_FILTER_DN_SUBTREE : SLAPD_FILTER_DN_ONE; - fand.f_dn = e->e_ndn; + fand.f_dn = &e->e_nname; fand.f_next = xf.f_or == filter ? filter : &xf ; candidates = filter_candidates( be, &f ); diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index fdddcc2870..542eca4094 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -565,7 +565,7 @@ typedef struct slap_filter { ber_int_t f_un_result; /* DN */ - char *f_un_dn; + struct berval *f_un_dn; /* present */ AttributeDescription *f_un_desc; -- 2.39.5