Commit 0c28b66a authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

use dnPretty instead of dn_pretty

parent a4a1325a
......@@ -35,7 +35,7 @@ do_add( Connection *conn, Operation *op )
{
BerElement *ber = op->o_ber;
char *last;
struct berval dn;
struct berval dn = { 0, NULL };
ber_len_t len;
ber_tag_t tag;
Entry *e;
......@@ -79,30 +79,58 @@ do_add( Connection *conn, Operation *op )
}
e = (Entry *) ch_calloc( 1, sizeof(Entry) );
e->e_dn = dn_pretty( dn.bv_val );
e->e_ndn = dn_normalize( dn.bv_val );
e->e_dn = NULL;
e->e_ndn = NULL;
e->e_attrs = NULL;
e->e_private = NULL;
if ( e->e_ndn == NULL ) {
{
struct berval *pdn;
rc = dnPretty( NULL, &dn, &pdn );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"do_add: conn %d invalid dn (%s)\n", conn->c_connid,
dn.bv_val ));
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"do_add: conn %d invalid dn (%s)\n", conn->c_connid,
dn.bv_val ));
#else
Debug( LDAP_DEBUG_ANY, "do_add: invalid dn (%s)\n", dn.bv_val, 0, 0 );
Debug( LDAP_DEBUG_ANY, "do_add: invalid dn (%s)\n", dn.bv_val, 0, 0 );
#endif
send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
"invalid DN", NULL, NULL );
goto done;
send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
"invalid DN", NULL, NULL );
goto done;
}
e->e_dn = pdn->bv_val;
free( pdn );
}
{
struct berval *ndn;
rc = dnNormalize( NULL, &dn, &ndn );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"do_add: conn %d invalid dn (%s)\n", conn->c_connid,
dn.bv_val ));
#else
Debug( LDAP_DEBUG_ANY, "do_add: invalid dn (%s)\n", dn.bv_val, 0, 0 );
#endif
send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
"invalid DN", NULL, NULL );
goto done;
}
e->e_ndn = ndn->bv_val;
free( ndn );
}
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
"do_add: conn %d ndn (%s)\n", conn->c_connid, e->e_ndn ));
"do_add: conn %d dn (%s)\n", conn->c_connid, e->e_dn ));
#else
Debug( LDAP_DEBUG_ARGS, "do_add: ndn (%s)\n", e->e_ndn, 0, 0 );
Debug( LDAP_DEBUG_ARGS, "do_add: dn (%s)\n", e->e_dn, 0, 0 );
#endif
/* get the attrs */
......@@ -132,8 +160,8 @@ do_add( Connection *conn, Operation *op )
if ( mod->ml_bvalues == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"do_add: conn %d no values for type %s\n",
conn->c_connid, mod->ml_type ));
"do_add: conn %d no values for type %s\n",
conn->c_connid, mod->ml_type ));
#else
Debug( LDAP_DEBUG_ANY, "no values for type %s\n",
mod->ml_type, 0, 0 );
......@@ -152,7 +180,7 @@ do_add( Connection *conn, Operation *op )
if ( ber_scanf( ber, /*{*/ "}") == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"do_add: conn %d ber_scanf failed\n", conn->c_connid ));
"do_add: conn %d ber_scanf failed\n", conn->c_connid ));
#else
Debug( LDAP_DEBUG_ANY, "do_add: ber_scanf failed\n", 0, 0, 0 );
#endif
......@@ -165,7 +193,7 @@ do_add( Connection *conn, Operation *op )
if( (rc = get_ctrls( conn, op, 1 )) != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"do_add: conn %d get_ctrls failed\n", conn->c_connid ));
"do_add: conn %d get_ctrls failed\n", conn->c_connid ));
#else
Debug( LDAP_DEBUG_ANY, "do_add: get_ctrls failed\n", 0, 0, 0 );
#endif
......@@ -179,7 +207,7 @@ do_add( Connection *conn, Operation *op )
}
Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%d ADD dn=\"%s\"\n",
op->o_connid, op->o_opid, e->e_ndn, 0, 0 );
op->o_connid, op->o_opid, e->e_dn, 0, 0 );
if( e->e_ndn == NULL || *e->e_ndn == '\0' ) {
/* protocolError may be a more appropriate error */
......@@ -190,7 +218,6 @@ do_add( Connection *conn, Operation *op )
#if defined( SLAPD_SCHEMA_DN )
} else if ( strcasecmp( e->e_ndn, SLAPD_SCHEMA_DN ) == 0 ) {
/* protocolError may be a more appropriate error */
send_ldap_result( conn, op, rc = LDAP_ALREADY_EXISTS,
NULL, "subschema subentry already exists",
NULL, NULL );
......@@ -320,6 +347,8 @@ do_add( Connection *conn, Operation *op )
}
done:
free( dn.bv_val );
if( modlist != NULL ) {
slap_modlist_free( modlist );
}
......
......@@ -33,17 +33,18 @@ do_bind(
Operation *op
)
{
BerElement *ber = op->o_ber;
ber_int_t version;
BerElement *ber = op->o_ber;
ber_int_t version;
ber_tag_t method;
char *mech;
char *mech = NULL;
struct berval dn = { 0, NULL };
char *ndn;
ber_tag_t tag;
int rc = LDAP_SUCCESS;
const char *text;
struct berval cred;
Backend *be;
struct berval *pdn = NULL;
struct berval *ndn = NULL;
ber_tag_t tag;
int rc = LDAP_SUCCESS;
const char *text;
struct berval cred = { 0, NULL };
Backend *be;
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
......@@ -52,10 +53,6 @@ do_bind(
Debug( LDAP_DEBUG_TRACE, "do_bind\n", 0, 0, 0 );
#endif
ndn = NULL;
mech = NULL;
cred.bv_val = NULL;
/*
* Force to connection to "anonymous" until bind succeeds.
*/
......@@ -152,9 +149,23 @@ do_bind(
goto cleanup;
}
ndn = ch_strdup( dn.bv_val );
rc = dnPretty( NULL, &dn, &pdn );
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"do_bind: conn %d invalid dn (%s)\n",
conn->c_connid, dn.bv_val ));
#else
Debug( LDAP_DEBUG_ANY, "bind: invalid dn (%s)\n",
dn.bv_val, 0, 0 );
#endif
send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
"invalid DN", NULL, NULL );
goto cleanup;
}
if ( dn_normalize( ndn ) == NULL ) {
rc = dnNormalize( NULL, &dn, &ndn );
if ( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"do_bind: conn %d invalid dn (%s)\n",
......@@ -172,27 +183,28 @@ do_bind(
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
"do_sasl_bind: conn %d dn (%s) mech %s\n", conn->c_connid,
dn.bv_val, mech ));
pdn->bv_val, mech ));
#else
Debug( LDAP_DEBUG_TRACE, "do_sasl_bind: dn (%s) mech %s\n",
dn.bv_val, mech, NULL );
pdn->bv_val, mech, NULL );
#endif
} else {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
"do_bind: conn %d version=%ld dn=\"%s\" method=%ld\n",
conn->c_connid, (unsigned long) version,
dn.bv_val, (unsigned long)method ));
pdn->bv_val, (unsigned long)method ));
#else
Debug( LDAP_DEBUG_TRACE,
"do_bind: version=%ld dn=\"%s\" method=%ld\n",
(unsigned long) version,
dn.bv_val, (unsigned long) method );
pdn->bv_val, (unsigned long) method );
#endif
}
Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%d BIND dn=\"%s\" method=%ld\n",
op->o_connid, op->o_opid, ndn, (unsigned long) method, 0 );
op->o_connid, op->o_opid, pdn->bv_val, (unsigned long) method, 0 );
if ( version < LDAP_VERSION_MIN || version > LDAP_VERSION_MAX ) {
#ifdef NEW_LOGGING
......@@ -277,7 +289,9 @@ do_bind(
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
edn = NULL;
rc = slap_sasl_bind( conn, op, dn.bv_val, ndn, &cred, &edn, &ssf );
rc = slap_sasl_bind( conn, op,
pdn->bv_val, ndn->bv_val,
&cred, &edn, &ssf );
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
if( rc == LDAP_SUCCESS ) {
......@@ -331,7 +345,7 @@ do_bind(
if ( method == LDAP_AUTH_SIMPLE ) {
/* accept "anonymous" binds */
if ( cred.bv_len == 0 || ndn == NULL || *ndn == '\0' ) {
if ( cred.bv_len == 0 || ndn->bv_len == 0 ) {
rc = LDAP_SUCCESS;
text = NULL;
......@@ -341,7 +355,7 @@ do_bind(
/* cred is not empty, disallow */
rc = LDAP_INVALID_CREDENTIALS;
} else if ( ndn != NULL && *ndn != '\0' &&
} else if ( ndn->bv_len &&
!( global_allows & SLAP_ALLOW_BIND_ANON_DN ))
{
/* DN is not empty, disallow */
......@@ -437,10 +451,10 @@ do_bind(
* if we don't hold it.
*/
if ( (be = select_backend( ndn, 0, 0 )) == NULL ) {
if ( (be = select_backend( ndn->bv_val, 0, 0 )) == NULL ) {
if ( default_referral ) {
struct berval **ref = referral_rewrite( default_referral,
NULL, dn.bv_val, LDAP_SCOPE_DEFAULT );
NULL, pdn->bv_val, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref ? ref : default_referral, NULL );
......@@ -472,15 +486,17 @@ do_bind(
char *edn = NULL;
/* deref suffix alias if appropriate */
ndn = suffix_alias( be, ndn );
ndn->bv_val = suffix_alias( be, ndn->bv_val );
ndn->bv_len = strlen( ndn->bv_val );
ret = (*be->be_bind)( be, conn, op, dn.bv_val, ndn,
ret = (*be->be_bind)( be, conn, op,
pdn->bv_val, ndn->bv_val,
method, &cred, &edn );
if ( ret == 0 ) {
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
conn->c_cdn = dn.bv_val;
conn->c_cdn = pdn->bv_val;
dn.bv_val = NULL;
dn.bv_len = 0;
......@@ -489,8 +505,9 @@ do_bind(
} else {
conn->c_dn = ch_strdup( conn->c_cdn );
}
conn->c_ndn = ndn;
ndn = NULL;
conn->c_ndn = ndn->bv_val;
ndn->bv_val = NULL;
ndn->bv_len = 0;
if( conn->c_dn != NULL ) {
ber_len_t max = sockbuf_max_incoming;
......@@ -503,7 +520,8 @@ do_bind(
"do_bind: conn %d v%d bind: \"%s\" to \"%s\" \n",
conn->c_connid, version, conn->c_cdn, conn->c_dn ));
#else
Debug( LDAP_DEBUG_TRACE, "do_bind: v%d bind: \"%s\" to \"%s\"\n",
Debug( LDAP_DEBUG_TRACE,
"do_bind: v%d bind: \"%s\" to \"%s\"\n",
version, conn->c_cdn, conn->c_dn );
#endif
......@@ -519,13 +537,17 @@ do_bind(
} else {
send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
NULL, "operation not supported within namingContext", NULL, NULL );
NULL, "operation not supported within namingContext",
NULL, NULL );
}
cleanup:
free( dn.bv_val );
if( pdn != NULL ) {
ber_bvfree( pdn );
}
if( ndn != NULL ) {
free( ndn );
ber_bvfree( ndn );
}
if ( mech != NULL ) {
free( mech );
......
......@@ -37,9 +37,10 @@ do_compare(
{
Entry *entry = NULL;
struct berval dn = { 0, NULL };
char *ndn = NULL;
struct berval desc;
struct berval value;
struct berval *pdn = NULL;
struct berval *ndn = NULL;
struct berval desc = { 0, NULL };
struct berval value = { 0, NULL };
struct berval *nvalue;
AttributeAssertion ava;
Backend *be;
......@@ -48,8 +49,6 @@ do_compare(
int manageDSAit;
ava.aa_desc = NULL;
desc.bv_val = NULL;
value.bv_val = NULL;
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY,
......@@ -117,9 +116,23 @@ do_compare(
goto cleanup;
}
ndn = ch_strdup( dn.bv_val );
rc = dnPretty( NULL, &dn, &pdn );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"do_compare: conn %d invalid dn (%s)\n",
conn->c_connid, dn.bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"do_compare: invalid dn (%s)\n", dn.bv_val, 0, 0 );
#endif
send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
"invalid DN", NULL, NULL );
goto cleanup;
}
if( dn_normalize( ndn ) == NULL ) {
rc = dnNormalize( NULL, &dn, &ndn );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"do_compare: conn %d invalid dn (%s)\n",
......@@ -147,20 +160,20 @@ do_compare(
ava.aa_value = nvalue;
if( strcasecmp( ndn, LDAP_ROOT_DSE ) == 0 ) {
if( strcasecmp( ndn->bv_val, LDAP_ROOT_DSE ) == 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
"do_compare: conn %d dn (%s) attr(%s) value (%s)\n",
conn->c_connid, dn.bv_val, ava.aa_desc->ad_cname.bv_val,
ava.aa_value->bv_val ));
conn->c_connid, pdn->bv_val,
ava.aa_desc->ad_cname.bv_val, ava.aa_value->bv_val ));
#else
Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n",
dn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value->bv_val );
pdn->bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value->bv_val );
#endif
Statslog( LDAP_DEBUG_STATS,
"conn=%ld op=%d CMP dn=\"%s\" attr=\"%s\"\n",
op->o_connid, op->o_opid, dn.bv_val,
op->o_connid, op->o_opid, pdn->bv_val,
ava.aa_desc->ad_cname.bv_val, 0 );
rc = backend_check_restrictions( NULL, conn, op, NULL, &text ) ;
......@@ -175,20 +188,20 @@ do_compare(
goto cleanup;
}
} else if ( strcasecmp( ndn, SLAPD_SCHEMA_DN ) == 0 ) {
} else if ( strcasecmp( ndn->bv_val, SLAPD_SCHEMA_DN ) == 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
"do_compare: conn %d dn (%s) attr(%s) value (%s)\n",
conn->c_connid, dn.bv_val, ava.aa_desc->ad_cname.bv_val,
conn->c_connid, pdn->bv_val, ava.aa_desc->ad_cname.bv_val,
ava.aa_value->bv_val ));
#else
Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n",
dn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value->bv_val );
pdn->bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value->bv_val );
#endif
Statslog( LDAP_DEBUG_STATS,
"conn=%ld op=%d CMP dn=\"%s\" attr=\"%s\"\n",
op->o_connid, op->o_opid, dn.bv_val,
op->o_connid, op->o_opid, pdn->bv_val,
ava.aa_desc->ad_cname.bv_val, 0 );
rc = backend_check_restrictions( NULL, conn, op, NULL, &text ) ;
......@@ -226,9 +239,9 @@ do_compare(
* appropriate one, or send a referral to our "referral server"
* if we don't hold it.
*/
if ( (be = select_backend( ndn, manageDSAit, 0 )) == NULL ) {
if ( (be = select_backend( ndn->bv_val, manageDSAit, 0 )) == NULL ) {
struct berval **ref = referral_rewrite( default_referral,
NULL, dn.bv_val, LDAP_SCOPE_DEFAULT );
NULL, pdn->bv_val, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref ? ref : default_referral, NULL );
......@@ -247,7 +260,7 @@ do_compare(
}
/* check for referrals */
rc = backend_check_referrals( be, conn, op, dn.bv_val, ndn );
rc = backend_check_referrals( be, conn, op, pdn->bv_val, ndn->bv_val );
if ( rc != LDAP_SUCCESS ) {
goto cleanup;
}
......@@ -255,30 +268,34 @@ do_compare(
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ARGS,
"do_compare: conn %d dn (%s) attr(%s) value (%s)\n",
conn->c_connid, dn.bv_val, ava.aa_desc->ad_cname.bv_val,
conn->c_connid, pdn->bv_val, ava.aa_desc->ad_cname.bv_val,
ava.aa_value->bv_val ));
#else
Debug( LDAP_DEBUG_ARGS, "do_compare: dn (%s) attr (%s) value (%s)\n",
dn.bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value->bv_val );
pdn->bv_val, ava.aa_desc->ad_cname.bv_val, ava.aa_value->bv_val );
#endif
Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%d CMP dn=\"%s\" attr=\"%s\"\n",
op->o_connid, op->o_opid, dn, ava.aa_desc->ad_cname.bv_val, 0 );
op->o_connid, op->o_opid, pdn->bv_val,
ava.aa_desc->ad_cname.bv_val, 0 );
/* deref suffix alias if appropriate */
ndn = suffix_alias( be, ndn );
ndn->bv_val = suffix_alias( be, ndn->bv_val );
ndn->bv_len = strlen( ndn->bv_val );
if ( be->be_compare ) {
(*be->be_compare)( be, conn, op, dn.bv_val, ndn, &ava );
(*be->be_compare)( be, conn, op, pdn->bv_val, ndn->bv_val, &ava );
} else {
send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
NULL, "operation not supported within namingContext", NULL, NULL );
NULL, "operation not supported within namingContext",
NULL, NULL );
}
cleanup:
free( dn.bv_val );
free( ndn );
ber_bvfree( pdn );
ber_bvfree( ndn );
free( desc.bv_val );
free( value.bv_val );
......
......@@ -953,9 +953,6 @@ read_config( const char *fname )
}
charray_add( &be->be_suffix, dn );
#ifndef USE_LDAP_DN_PARSING
(void) ldap_pvt_str2upper( dn );
#else /* USE_LDAP_DN_PARSING */
if ( dn_normalize( dn ) == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
......@@ -970,7 +967,6 @@ read_config( const char *fname )
free( dn );
return 1;
}
#endif /* USE_LDAP_DN_PARSING */
ber_bvecadd( &be->be_nsuffix, ber_bvstr( dn ) );
}
......
......@@ -32,7 +32,8 @@ do_delete(
)
{
struct berval dn = { 0, NULL };
char *ndn = NULL;
struct berval *ndn = NULL;
struct berval *pdn = NULL;
const char *text;
Backend *be;
int rc;
......@@ -73,23 +74,37 @@ do_delete(
goto cleanup;
}
ndn = ch_strdup( dn.bv_val );
rc = dnPretty( NULL, &dn, &pdn );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"do_delete: conn %d invalid dn (%s)\n",
conn->c_connid, dn.bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"do_delete: invalid dn (%s)\n", dn.bv_val, 0, 0 );
#endif
send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
"invalid DN", NULL, NULL );
goto cleanup;
}
if( dn_normalize( ndn ) == NULL ) {
rc = dnNormalize( NULL, &dn, &ndn );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"do_delete: conn %d invalid dn (%s).\n",
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"do_delete: conn %d invalid dn (%s)\n",
conn->c_connid, dn.bv_val ));
#else
Debug( LDAP_DEBUG_ANY, "do_delete: invalid dn (%s)\n",
dn.bv_val, 0, 0 );
Debug( LDAP_DEBUG_ANY,
"do_delete: invalid dn (%s)\n", dn.bv_val, 0, 0 );
#endif
send_ldap_result( conn, op, rc = LDAP_INVALID_DN_SYNTAX, NULL,
"invalid DN", NULL, NULL );
goto cleanup;
}
if( *ndn == '\0' ) {
if( ndn->bv_len == 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO, "do_delete: conn %d: "
"Attempt to delete root DSE.\n", conn->c_connid ));
......@@ -102,7 +117,8 @@ do_delete(
goto cleanup;
#ifdef SLAPD_SCHEMA_DN
} else if ( strcasecmp( ndn, SLAPD_SCHEMA_DN ) == 0 ) {
} else if ( strcasecmp( ndn->bv_val, SLAPD_SCHEMA_DN ) == 0 ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO, "do_delete: conn %d: "
"Attempt to delete subschema subentry.\n", conn->c_connid ));
......@@ -118,7 +134,7 @@ do_delete(
}
Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%d DEL dn=\"%s\"\n",
op->o_connid, op->o_opid, dn.bv_val, 0, 0 );
op->o_connid, op->o_opid, pdn->bv_val, 0, 0 );
manageDSAit = get_manageDSAit( op );
......@@ -127,9 +143,9 @@ do_delete(
* appropriate one, or send a referral to our "referral server"
* if we don't hold it.
*/
if ( (be = select_backend( ndn, manageDSAit, 0 )) == NULL ) {
if ( (be = select_backend( ndn->bv_val, manageDSAit, 0 )) == NULL ) {
struct berval **ref = referral_rewrite( default_referral,
NULL, dn.bv_val, LDAP_SCOPE_DEFAULT );
NULL, pdn->bv_val, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref ? ref : default_referral, NULL );
......@@ -147,13 +163,14 @@ do_delete(
}
/* check for referrals */
rc = backend_check_referrals( be, conn, op, dn.bv_val, ndn );
rc = backend_check_referrals( be, conn, op, pdn->bv_val, ndn->bv_val );
if ( rc != LDAP_SUCCESS ) {
goto cleanup;
}
/* deref suffix alias if appropriate */
ndn = suffix_alias( be, ndn );
ndn->bv_val = suffix_alias( be, ndn->bv_val );
ndn->bv_len = strlen( ndn->bv_val );
/*
* do the delete if 1 && (2 || 3)
......@@ -168,12 +185,12 @@ do_delete(
if ( be->be_update_ndn == NULL || repl_user )
#endif
{