/*
- * Copyright 1998-2001 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*
* Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
Backend *be,
Connection *conn,
Operation *op,
- const char *dn,
- const char *ndn,
+ struct berval *dn,
+ struct berval *ndn,
AttributeAssertion *ava
)
{
*/
for ( i = 0, lsc = lc->conns; lsc[ 0 ] != NULL; ++i, ++lsc ) {
char *mdn = NULL;
- char *mapped_attr = ava->aa_desc->ad_cname->bv_val;
- char *mapped_value = ava->aa_value->bv_val;
+ struct berval mapped_attr = ava->aa_desc->ad_cname;
+ struct berval mapped_value = ava->aa_value;
if ( lsc[ 0 ]->candidate != META_CANDIDATE ) {
continue;
* Rewrite the compare dn, if needed
*/
switch ( rewrite_session( li->targets[ i ]->rwinfo,
- "compareDn", dn, conn, &mdn ) ) {
+ "compareDn",
+ dn->bv_val, conn, &mdn ) ) {
case REWRITE_REGEXEC_OK:
if ( mdn == NULL ) {
- mdn = ( char * )dn;
+ mdn = ( char * )dn->bv_val;
}
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
- "[rw] compareDn: \"%s\" -> \"%s\"\n",
- dn, mdn ));
+ LDAP_LOG( BACK_META, DETAIL1,
+ "[rw] compareDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ARGS,
"rw> compareDn: \"%s\" -> \"%s\"\n%s",
- dn, mdn, "" );
+ dn->bv_val, mdn, "" );
#endif /* !NEW_LOGGING */
break;
*/
if ( ava->aa_desc->ad_type->sat_oid
== slap_schema.si_ad_objectClass->ad_type->sat_oid ) {
- mapped_value = ldap_back_map( &li->targets[ i ]->oc_map,
- ava->aa_value->bv_val, 0 );
+ ldap_back_map( &li->targets[ i ]->oc_map,
+ &ava->aa_value, &mapped_value, 0 );
- if ( mapped_value == NULL ) {
+ if ( mapped_value.bv_val == NULL ) {
lsc[ 0 ]->candidate = META_NOT_CANDIDATE;
continue;
}
* else try to remap the attribute
*/
} else {
- mapped_attr = ldap_back_map( &li->targets[ i ]->at_map,
- ava->aa_desc->ad_cname->bv_val, 0 );
- if ( mapped_attr == NULL ) {
+ ldap_back_map( &li->targets[ i ]->at_map,
+ &ava->aa_desc->ad_cname, &mapped_attr, 0 );
+ if ( mapped_attr.bv_val == NULL ) {
lsc[ 0 ]->candidate = META_NOT_CANDIDATE;
continue;
}
* of the result ought to be enforced
*/
msgid[ i ] = ldap_compare( lc->conns[ i ]->ld, mdn,
- mapped_attr, mapped_value );
+ mapped_attr.bv_val, mapped_value.bv_val );
if ( msgid[ i ] == -1 ) {
lsc[ 0 ]->candidate = META_NOT_CANDIDATE;
continue;
}
- if ( mdn != dn ) {
+ if ( mdn != dn->bv_val ) {
free( mdn );
}
- if ( mapped_attr != ava->aa_desc->ad_cname->bv_val ) {
- free( mapped_attr );
+ if ( mapped_attr.bv_val != ava->aa_desc->ad_cname.bv_val ) {
+ free( mapped_attr.bv_val );
}
- if ( mapped_value != ava->aa_value->bv_val ) {
- free( mapped_value );
+ if ( mapped_value.bv_val != ava->aa_value.bv_val ) {
+ free( mapped_value.bv_val );
}
++candidates;
* sending to cache ...
*/
if ( li->cache.ttl != META_DNCACHE_DISABLED ) {
- ( void )meta_dncache_update_entry( &li->cache, ch_strdup( ndn ), i );
+ ( void )meta_dncache_update_entry( &li->cache, ndn, i );
}
count++;
mmatch = ( char * )match;
}
#ifdef NEW_LOGGING
- LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
- "[rw] matchedDn: \"%s\" -> \"%s\"\n",
- match, mmatch ));
+ LDAP_LOG( BACK_META, DETAIL1,
+ "[rw] matchedDn: \"%s\" -> \"%s\"\n", match, mmatch, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ARGS, "rw> matchedDn:"
" \"%s\" -> \"%s\"\n%s",