X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-bdb%2Ftools.c;h=bafba3549e7a2ef597aba98f95496bcdc354d59f;hb=739128a0165d795a1c6110696768614efcfefe50;hp=c64176b963c214c189f7dfda1a8936154048af0e;hpb=11a13493663685d2956f4335175239aa5c2e1826;p=openldap diff --git a/servers/slapd/back-bdb/tools.c b/servers/slapd/back-bdb/tools.c index c64176b963..bafba3549e 100644 --- a/servers/slapd/back-bdb/tools.c +++ b/servers/slapd/back-bdb/tools.c @@ -140,7 +140,8 @@ ID bdb_tool_dn2id_get( { Operation op = {0}; Opheader ohdr = {0}; - EntryInfo ei = {0}; + EntryInfo *ei = NULL; + int rc; if ( BER_BVISEMPTY(dn) ) return 0; @@ -150,11 +151,12 @@ ID bdb_tool_dn2id_get( op.o_tmpmemctx = NULL; op.o_tmpmfuncs = &ch_mfuncs; - ei.bei_id = NOID; - - bdb_dn2id( &op, NULL, dn, &ei ); + rc = bdb_cache_find_ndn( &op, NULL, dn, &ei ); + if ( ei ) bdb_cache_entryinfo_unlock( ei ); + if ( rc == DB_NOTFOUND ) + return NOID; - return ei.bei_id; + return ei->bei_id; } int bdb_tool_id2entry_get( @@ -183,7 +185,9 @@ Entry* bdb_tool_entry_get( BackendDB *be, ID id ) { int rc; Entry *e = NULL; +#ifndef BDB_HIER struct berval bv; +#endif assert( be != NULL ); assert( slapMode & SLAP_TOOL_MODE ); @@ -327,8 +331,8 @@ ID bdb_tool_entry_put( assert( be != NULL ); assert( slapMode & SLAP_TOOL_MODE ); - assert( text ); - assert( text->bv_val ); + assert( text != NULL ); + assert( text->bv_val != NULL ); assert( text->bv_val[0] == '\0' ); /* overconservative? */ Debug( LDAP_DEBUG_TRACE, "=> " LDAP_XSTRING(bdb_tool_entry_put) @@ -524,8 +528,8 @@ ID bdb_tool_entry_modify( assert( be != NULL ); assert( slapMode & SLAP_TOOL_MODE ); - assert( text ); - assert( text->bv_val ); + assert( text != NULL ); + assert( text->bv_val != NULL ); assert( text->bv_val[0] == '\0' ); /* overconservative? */ assert ( e->e_id != NOID );