)
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
- char *pdn;
+ struct berval pdn;
Entry *p = NULL;
int rootlock = 0;
int rc;
/* nobody else can add until we lock our parent */
ldap_pvt_thread_mutex_lock(&li->li_add_mutex);
- if ( ( rc = dn2id( be, e->e_ndn, &id ) ) || id != NOID ) {
+ if ( ( rc = dn2id( be, &e->e_nname, &id ) ) || id != NOID ) {
/* if (rc) something bad happened to ldbm cache */
ldap_pvt_thread_mutex_unlock(&li->li_add_mutex);
send_ldap_result( conn, op,
* add the entry.
*/
- pdn = dn_parent( be, e->e_ndn );
+ pdn.bv_val = dn_parent( be, e->e_ndn );
+ if (pdn.bv_val && pdn.bv_val[0])
+ pdn.bv_len = e->e_nname.bv_len - (pdn.bv_val - e->e_ndn);
+ else
+ pdn.bv_len = 0;
- if( pdn != NULL && *pdn != '\0' ) {
+ if( pdn.bv_len ) {
Entry *matched = NULL;
- assert( *pdn != '\0' );
-
/* get parent with writer lock */
- if ( (p = dn2entry_w( be, pdn, &matched )) == NULL ) {
+ if ( (p = dn2entry_w( be, &pdn, &matched )) == NULL ) {
char *matched_dn = NULL;
struct berval **refs;
}
} else {
- if(pdn != NULL) {
- assert( *pdn == '\0' );
+ if(pdn.bv_val != NULL) {
+ assert( *pdn.bv_val == '\0' );
}
/* no parent, must be adding entry to root */
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
"ldbm_back_add: %s add denied.\n",
- pdn == NULL ? "suffix"
+ pdn.bv_val == NULL ? "suffix"
: "entry at root" ));
#else
Debug( LDAP_DEBUG_TRACE, "%s add denied\n",
- pdn == NULL ? "suffix"
+ pdn.bv_val == NULL ? "suffix"
: "entry at root", 0, 0 );
#endif
}
/* dn2id index */
- if ( dn2id_add( be, e->e_ndn, e->e_id ) != 0 ) {
+ if ( dn2id_add( be, &e->e_nname, e->e_id ) != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
"ldbm_back_add: dn2id_add failed.\n" ));
#endif
/* FIXME: delete attr indices? */
- (void) dn2id_delete( be, e->e_ndn, e->e_id );
+ (void) dn2id_delete( be, &e->e_nname, e->e_id );
send_ldap_result( conn, op, LDAP_OTHER,
NULL, "entry store failed", NULL, NULL );
#include "proto-back-ldbm.h"
-static char* get_alias_dn(
+static int get_alias_dn(
Entry *e,
+ struct berval *al,
int *err,
const char **errmsg );
-static char* new_superior(
- const char *dn,
- const char *oldSup,
- const char *newSup );
+static void new_superior(
+ struct berval *dn,
+ struct berval *oldSup,
+ struct berval *newSup,
+ struct berval *res );
static int dnlist_subordinate(
- char** dnlist,
- const char *dn );
+ BVarray dnlist,
+ struct berval *dn );
Entry *deref_internal_r(
Backend* be,
Entry** matched,
const char** text )
{
- char *dn;
+ struct berval dn;
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
Entry *entry;
Entry *sup;
unsigned depth;
- char **dnlist;
+ BVarray dnlist;
assert( ( alias != NULL && dn_in == NULL )
|| ( alias == NULL && dn_in != NULL ) );
*text = NULL;
if( alias == NULL ) {
- dn = ch_strdup( dn_in->bv_val );
- entry = dn2entry_r( be, dn, &sup );
+ ber_dupbv( &dn, dn_in );
+ entry = dn2entry_r( be, &dn, &sup );
} else {
- dn = ch_strdup( alias->e_ndn );
+ ber_dupbv( &dn, &alias->e_nname );
entry = alias;
sup = NULL;
}
dnlist = NULL;
- charray_add( &dnlist, dn );
+ bvarray_add( &dnlist, &dn );
for( depth=0 ; ; depth++ ) {
if( entry != NULL ) {
Entry *newe;
- char *aliasDN;
+ struct berval aliasDN;
/* have entry, may be an alias */
}
/* deref entry */
- aliasDN = get_alias_dn( entry, err, text );
-
- if( aliasDN == NULL ) {
+ if( get_alias_dn( entry, &aliasDN, err, text )) {
*matched = entry;
entry = NULL;
break;
}
/* check if aliasDN is a subordinate of any DN in our list */
- if( dnlist_subordinate( dnlist, aliasDN ) ) {
- ch_free( aliasDN );
+ if( dnlist_subordinate( dnlist, &aliasDN ) ) {
+ ch_free( aliasDN.bv_val );
*matched = entry;
entry = NULL;
*err = LDAP_ALIAS_PROBLEM;
/* attempt to dereference alias */
- newe = dn2entry_r( be, aliasDN, &sup );
- ch_free( aliasDN );
+ newe = dn2entry_r( be, &aliasDN, &sup );
+ ch_free( aliasDN.bv_val );
if( newe != NULL ) {
- free( dn );
+ free( dn.bv_val );
cache_return_entry_r(&li->li_cache, entry );
entry = newe;
- dn = ch_strdup( entry->e_ndn );
- charray_add( &dnlist, dn );
+ ber_dupbv( &dn, &entry->e_nname );
+ bvarray_add( &dnlist, &dn );
continue;
}
/* have superior, may be an alias */
Entry *newe;
Entry *newSup;
- char *supDN;
- char *aliasDN;
+ struct berval supDN;
+ struct berval aliasDN;
if( !is_entry_alias( sup ) ) {
/* entry is not an alias */
}
/* deref entry */
- supDN = get_alias_dn( sup, err, text );
-
- if( supDN == NULL ) {
+ if( get_alias_dn( sup, &supDN, err, text )) {
*matched = sup;
break;
}
- aliasDN = new_superior( dn, sup->e_ndn, supDN );
- free(supDN);
-
- if( aliasDN == NULL ) {
- free(aliasDN);
- *matched = sup;
- *err = LDAP_ALIAS_PROBLEM;
- *text = "superior alias problem";
- break;
- }
+ new_superior( &dn, &sup->e_nname, &supDN, &aliasDN );
+ free(supDN.bv_val);
/* check if aliasDN is a subordinate of any DN in our list */
- if( dnlist_subordinate( dnlist, aliasDN ) ) {
- free(aliasDN);
+ if( dnlist_subordinate( dnlist, &aliasDN ) ) {
+ free(aliasDN.bv_val);
*matched = entry;
entry = NULL;
*err = LDAP_ALIAS_PROBLEM;
}
/* attempt to dereference alias */
- newe = dn2entry_r( be, aliasDN, &newSup );
+ newe = dn2entry_r( be, &aliasDN, &newSup );
if( newe != NULL ) {
- free(aliasDN);
- free( dn );
+ free(aliasDN.bv_val);
+ free( dn.bv_val );
cache_return_entry_r(&li->li_cache, sup );
entry = newe;
- dn = ch_strdup( entry->e_ndn );
- charray_add( &dnlist, dn );
+ ber_dupbv( &dn, &entry->e_nname );
+ bvarray_add( &dnlist, &dn );
continue;
-
}
if ( newSup != NULL ) {
- free( dn );
+ free( dn.bv_val );
cache_return_entry_r(&li->li_cache, sup );
sup = newSup;
- dn = aliasDN;
+ ber_dupbv( &dn, &aliasDN );
continue;
}
}
}
- free( dn );
- charray_free( dnlist );
+ free( dn.bv_val );
+ bvarray_free( dnlist );
return entry;
}
-static char* get_alias_dn(
+static int get_alias_dn(
Entry *e,
+ struct berval *ndn,
int *err,
const char **errmsg )
{
int rc;
- struct berval ndn;
Attribute *a;
AttributeDescription *aliasedObjectName
= slap_schema.si_ad_aliasedObjectName;
*/
*err = LDAP_ALIAS_PROBLEM;
*errmsg = "alias missing aliasedObjectName attribute";
- return NULL;
+ return -1;
}
/*
*/
*err = LDAP_ALIAS_PROBLEM;
*errmsg = "alias missing aliasedObjectName value";
- return NULL;
+ return -1;
}
if( a->a_vals[1] != NULL ) {
*err = LDAP_ALIAS_PROBLEM;
*errmsg = "alias has multivalued aliasedObjectName";
- return NULL;
+ return -1;
}
- rc = dnNormalize2( NULL, a->a_vals[0], &ndn );
+ rc = dnNormalize2( NULL, a->a_vals[0], ndn );
if( rc != LDAP_SUCCESS ) {
*err = LDAP_ALIAS_PROBLEM;
*errmsg = "alias aliasedObjectName value is invalid";
- return NULL;
+ return -1;
}
- return ndn.bv_val;
+ return 0;
}
-static char* new_superior(
- const char *dn,
- const char *oldSup,
- const char *newSup )
+static void new_superior(
+ struct berval *dn,
+ struct berval *oldSup,
+ struct berval *newSup,
+ struct berval *newDN )
{
- char *newDN;
size_t dnlen, olen, nlen;
- assert( dn && oldSup && newSup );
+ assert( dn && oldSup && newSup && newDN );
- dnlen = strlen( dn );
- olen = strlen( oldSup );
- nlen = strlen( newSup );
+ dnlen = dn->bv_len;
+ olen = oldSup->bv_len;
+ nlen = newSup->bv_len;
- newDN = ch_malloc( dnlen - olen + nlen + 1 );
+ newDN->bv_val = ch_malloc( dnlen - olen + nlen + 1 );
- AC_MEMCPY( newDN, dn, dnlen - olen );
- AC_MEMCPY( &newDN[dnlen - olen], newSup, nlen );
- newDN[dnlen - olen + nlen] = '\0';
+ AC_MEMCPY( newDN->bv_val, dn->bv_val, dnlen - olen );
+ AC_MEMCPY( &newDN->bv_val[dnlen - olen], newSup->bv_val, nlen );
+ newDN->bv_val[dnlen - olen + nlen] = '\0';
- return newDN;
+ return;
}
static int dnlist_subordinate(
- char** dnlist,
- const char *dn )
+ BVarray dnlist,
+ struct berval *dn )
{
- int i;
assert( dnlist );
- for( i = 0; dnlist[i] != NULL; i++ ) {
- if( dn_issuffix( dnlist[i], dn ) ) {
+ for( ; dnlist->bv_val != NULL; dnlist++ ) {
+ if( dnIsSuffix( dnlist, dn ) ) {
return 1;
}
}
return 0;
}
-
} else {
/* can we find entry with reader lock */
- if ((e = dn2entry_r(be, entry_ndn->bv_val, NULL )) == NULL) {
+ if ((e = dn2entry_r(be, entry_ndn, NULL )) == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_back_attribute: cannot find entry (%s)\n",
dn = ndn;
/* get entry with reader lock */
- if ( (e = dn2entry_r( be, dn->bv_val, &matched )) == NULL ) {
+ if ( (e = dn2entry_r( be, dn, &matched )) == NULL ) {
char *matched_dn = NULL;
struct berval **refs = NULL;
return( 0 );
}
-/*
- * cache_find_entry_dn2id - find an entry in the cache, given dn
- */
-
-ID
-cache_find_entry_dn2id(
- Backend *be,
- Cache *cache,
- const char *dn
-)
-{
- int rc;
- struct berval bv;
- struct berval ndn;
- ID id;
-
- bv.bv_val = (char *)dn;
- bv.bv_len = strlen( dn );
-
- rc = dnNormalize2( NULL, &bv, &ndn );
- if( rc != LDAP_SUCCESS ) {
- return NOID;
- }
-
- id = cache_find_entry_ndn2id( be, cache, ndn.bv_val );
-
- free( ndn.bv_val );
- return ( id );
-}
-
ID
cache_find_entry_ndn2id(
Backend *be,
Cache *cache,
- const char *ndn
+ struct berval *ndn
)
{
Entry e, *ep;
int count = 0;
/* this function is always called with normalized DN */
- e.e_ndn = (char *)ndn;
+ e.e_nname = *ndn;
try_again:
/* set cache mutex */
int manageDSAit = get_manageDSAit( op );
/* get entry with reader lock */
- if ( (e = dn2entry_r( be, ndn->bv_val, &matched )) == NULL ) {
+ if ( (e = dn2entry_r( be, ndn, &matched )) == NULL ) {
char *matched_dn = NULL;
struct berval **refs = NULL;
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
Entry *matched;
- char *pdn = NULL;
+ struct berval pdn;
Entry *e, *p = NULL;
int rootlock = 0;
int rc = -1;
#endif
/* get entry with writer lock */
- if ( (e = dn2entry_w( be, ndn->bv_val, &matched )) == NULL ) {
+ if ( (e = dn2entry_w( be, ndn, &matched )) == NULL ) {
char *matched_dn = NULL;
struct berval **refs;
}
/* delete from parent's id2children entry */
- if( (pdn = dn_parent( be, e->e_ndn )) != NULL && pdn[ 0 ] != '\0' ) {
- if( (p = dn2entry_w( be, pdn, NULL )) == NULL) {
+ if( (pdn.bv_val = dn_parent( be, e->e_ndn )) != NULL && pdn.bv_val[ 0 ] != '\0' ) {
+ pdn.bv_len = e->e_nname.bv_len - (pdn.bv_val - e->e_ndn);
+ if( (p = dn2entry_w( be, &pdn, NULL )) == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
"ldbm_back_delete: parent of (%s) does not exist\n", dn ));
}
/* delete from dn2id mapping */
- if ( dn2id_delete( be, e->e_ndn, e->e_id ) != 0 ) {
+ if ( dn2id_delete( be, &e->e_nname, e->e_id ) != 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
"ldbm_back_delete: (%s) operations error\n",
int
dn2id_add(
Backend *be,
- const char *dn,
+ struct berval *dn,
ID id
)
{
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
- "dn2id_add: (%s):%ld\n", dn, id ));
+ "dn2id_add: (%s):%ld\n", dn->bv_val, id ));
#else
- Debug( LDAP_DEBUG_TRACE, "=> dn2id_add( \"%s\", %ld )\n", dn, id, 0 );
+ Debug( LDAP_DEBUG_TRACE, "=> dn2id_add( \"%s\", %ld )\n", dn->bv_val, id, 0 );
#endif
assert( id != NOID );
}
ldbm_datum_init( key );
- key.dsize = strlen( dn ) + 2;
+ key.dsize = dn->bv_len + 2;
buf = ch_malloc( key.dsize );
key.dptr = buf;
buf[0] = DN_BASE_PREFIX;
ptr = buf + 1;
- strcpy( ptr, dn );
+ strcpy( ptr, dn->bv_val );
ldbm_datum_init( data );
data.dptr = (char *) &id;
int
dn2id(
Backend *be,
- const char *dn,
+ struct berval *dn,
ID *idp
)
{
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
- "dn2id: (%s)\n", dn ));
+ "dn2id: (%s)\n", dn->bv_val ));
#else
- Debug( LDAP_DEBUG_TRACE, "=> dn2id( \"%s\" )\n", dn, 0, 0 );
+ Debug( LDAP_DEBUG_TRACE, "=> dn2id( \"%s\" )\n", dn->bv_val, 0, 0 );
#endif
assert( idp );
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", DN_BASE_PREFIX, dn );
+ sprintf( key.dptr, "%c%s", DN_BASE_PREFIX, dn->bv_val );
data = ldbm_cache_fetch( db, key );
int
dn2id_delete(
Backend *be,
- const char *dn,
+ struct berval *dn,
ID id
)
{
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
- "dn2id_delete: (%s)%ld\n", dn, id ));
+ "dn2id_delete: (%s)%ld\n", dn->bv_val, id ));
#else
- Debug( LDAP_DEBUG_TRACE, "=> dn2id_delete( \"%s\", %ld )\n", dn, id, 0 );
+ Debug( LDAP_DEBUG_TRACE, "=> dn2id_delete( \"%s\", %ld )\n", dn->bv_val, id, 0 );
#endif
}
ldbm_datum_init( key );
- key.dsize = strlen( dn ) + 2;
+ key.dsize = dn->bv_len + 2;
buf = ch_malloc( key.dsize );
key.dptr = buf;
buf[0] = DN_BASE_PREFIX;
ptr = buf + 1;
- strcpy( ptr, dn );
+ strcpy( ptr, dn->bv_val );
rc = ldbm_cache_delete( db, key );
Entry *
dn2entry_rw(
Backend *be,
- const char *dn,
+ struct berval *dn,
Entry **matched,
int rw
)
{
ID id;
Entry *e = NULL;
- char *pdn;
+ struct berval pdn;
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
"dn2entry_rw: %s entry %s\n", rw ? "w" : "r",
- dn ));
+ dn->bv_val ));
#else
Debug(LDAP_DEBUG_TRACE, "dn2entry_%s: dn: \"%s\"\n",
- rw ? "w" : "r", dn, 0);
+ rw ? "w" : "r", dn->bv_val, 0);
#endif
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
"dn2entry_rw: no entry for valid id (%ld), dn (%s)\n",
- id, dn ));
+ id, dn->bv_val ));
#else
Debug(LDAP_DEBUG_ANY,
"dn2entry_%s: no entry for valid id (%ld), dn \"%s\"\n",
- rw ? "w" : "r", id, dn);
+ rw ? "w" : "r", id, dn->bv_val);
#endif
/* must have been deleted from underneath us */
/* entry does not exist - see how much of the dn does exist */
/* dn_parent checks returns NULL if dn is suffix */
- if ( (pdn = dn_parent( be, dn )) != NULL ) {
+ if ( (pdn.bv_val = dn_parent( be, dn->bv_val )) != NULL && *pdn.bv_val ) {
+ pdn.bv_len = dn->bv_len - (pdn.bv_val - dn->bv_val);
/* get entry with reader lock */
- if ( (e = dn2entry_r( be, pdn, matched )) != NULL ) {
+ if ( (e = dn2entry_r( be, &pdn, matched )) != NULL ) {
*matched = e;
}
}
} else {
/* can we find group entry with reader lock */
- if ((e = dn2entry_r(be, gr_ndn->bv_val, NULL )) == NULL) {
+ if ((e = dn2entry_r(be, gr_ndn, NULL )) == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
"ldbm_back_group: cannot find group (%s)\n",
/* acquire and lock entry */
- if ( (e = dn2entry_w( be, ndn->bv_val, &matched )) == NULL ) {
+ if ( (e = dn2entry_w( be, ndn, &matched )) == NULL ) {
char* matched_dn = NULL;
struct berval **refs;
#endif
/* get entry with writer lock */
- if ( (e = dn2entry_w( be, ndn->bv_val, &matched )) == NULL ) {
+ if ( (e = dn2entry_w( be, ndn, &matched )) == NULL ) {
char* matched_dn = NULL;
struct berval** refs;
* children.
*/
- if( (p = dn2entry_w( be, p_ndn.bv_val, NULL )) == NULL) {
+ if( (p = dn2entry_w( be, &p_ndn, NULL )) == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
"ldbm_back_modrdn: parent of %s does not exist\n", e->e_ndn ));
/* Get Entry with dn=newSuperior. Does newSuperior exist? */
if ( nnewSuperior->bv_len ) {
- if( (np = dn2entry_w( be, np_ndn->bv_val, NULL )) == NULL) {
+ if( (np = dn2entry_w( be, np_ndn, NULL )) == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
"ldbm_back_modrdn: newSup(ndn=%s) not found.\n", np_ndn->bv_val ));
}
ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
- if ( ( rc_id = dn2id ( be, new_ndn.bv_val, &id ) ) || id != NOID ) {
+ if ( ( rc_id = dn2id ( be, &new_ndn, &id ) ) || id != NOID ) {
/* if (rc_id) something bad happened to ldbm cache */
send_ldap_result( conn, op,
rc_id ? LDAP_OPERATIONS_ERROR : LDAP_ALREADY_EXISTS,
ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
/* delete old one */
- if ( dn2id_delete( be, e->e_ndn, e->e_id ) != 0 ) {
+ if ( dn2id_delete( be, &e->e_nname, e->e_id ) != 0 ) {
send_ldap_result( conn, op, LDAP_OTHER,
NULL, "DN index delete fail", NULL, NULL );
goto return_results;
new_ndn.bv_val = NULL;
/* add new one */
- if ( dn2id_add( be, e->e_ndn, e->e_id ) != 0 ) {
+ if ( dn2id_add( be, &e->e_nname, e->e_id ) != 0 ) {
send_ldap_result( conn, op, LDAP_OTHER,
NULL, "DN index add failed", NULL, NULL );
goto return_results;
}
/* here we may try to delete the newly added dn */
- if ( dn2id_delete( be, e->e_ndn, e->e_id ) != 0 ) {
+ if ( dn2id_delete( be, &e->e_nname, e->e_id ) != 0 ) {
/* we already are in trouble ... */
;
}
goto done;
}
- e = dn2entry_w( be, ndn.bv_val, NULL );
+ e = dn2entry_w( be, &ndn, NULL );
if( e == NULL ) {
*text = "could not locate authorization entry";
rc = LDAP_NO_SUCH_OBJECT;
#define cache_return_entry_w(c, e) cache_return_entry_rw((c), (e), 1)
void cache_entry_commit LDAP_P(( Entry *e ));
-ID cache_find_entry_dn2id LDAP_P(( Backend *be, Cache *cache, const char *dn ));
-ID cache_find_entry_ndn2id LDAP_P(( Backend *be, Cache *cache, const char *ndn ));
+ID cache_find_entry_ndn2id LDAP_P(( Backend *be, Cache *cache, struct berval *ndn ));
Entry * cache_find_entry_id LDAP_P(( Cache *cache, ID id, int rw ));
int cache_delete_entry LDAP_P(( Cache *cache, Entry *e ));
void cache_release_all LDAP_P(( Cache *cache ));
* dn2id.c
*/
-int dn2id_add LDAP_P(( Backend *be, const char *dn, ID id ));
-int dn2id LDAP_P(( Backend *be, const char *dn, ID *idp ));
+int dn2id_add LDAP_P(( Backend *be, struct berval *dn, ID id ));
+int dn2id LDAP_P(( Backend *be, struct berval *dn, ID *idp ));
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 ));
+int dn2id_delete LDAP_P(( Backend *be, struct berval *dn, ID id ));
-Entry * dn2entry_rw LDAP_P(( Backend *be, const char *dn, Entry **matched, int rw ));
+Entry * dn2entry_rw LDAP_P(( Backend *be, struct berval *dn, Entry **matched, int rw ));
#define dn2entry_r(be, dn, m) dn2entry_rw((be), (dn), (m), 0)
#define dn2entry_w(be, dn, m) dn2entry_rw((be), (dn), (m), 1)
}
/* get entry with reader lock */
- e = dn2entry_r( be, ndn->bv_val, &matched );
+ e = dn2entry_r( be, ndn, &matched );
if ( e == NULL ) {
char *matched_dn = NULL;
struct berval **refs = NULL;
} else {
/* get entry with reader lock */
- e = dn2entry_r( be, nbase->bv_val, &matched );
+ e = dn2entry_r( be, nbase, &matched );
err = e != NULL ? LDAP_SUCCESS : LDAP_REFERRAL;
text = NULL;
}
e->e_id, e->e_dn, 0 );
#endif
- if ( dn2id( be, e->e_ndn, &id ) ) {
+ if ( dn2id( be, &e->e_nname, &id ) ) {
/* something bad happened to ldbm cache */
return NOID;
}
return NOID;
}
- rc = dn2id_add( be, e->e_ndn, e->e_id );
+ rc = dn2id_add( be, &e->e_nname, e->e_id );
if( rc != 0 ) {
return NOID;
}
rc = ldbm_cache_store( id2entry, key, data, LDBM_REPLACE );
if( rc != 0 ) {
- (void) dn2id_delete( be, e->e_ndn, e->e_id );
+ (void) dn2id_delete( be, &e->e_nname, e->e_id );
return NOID;
}
id, e->e_dn, 0 );
#endif
- dn2id_add( be, e->e_ndn, e->e_id );
+ dn2id_add( be, &e->e_nname, e->e_id );
rc = index_entry_add( be, e, e->e_attrs );
entry_free( e );