/*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*
* Copyright 2001, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
lc = meta_back_getconn( li, conn, op, META_OP_ALLOW_MULTIPLE,
ndn, NULL );
if ( !lc || !meta_back_dobind( lc, op ) ) {
+ send_ldap_result( conn, op, LDAP_OTHER,
+ NULL, NULL, NULL, NULL );
return -1;
}
struct berval mapped_value = ava->aa_value;
if ( lsc->candidate != META_CANDIDATE ) {
+ msgid[ i ] = -1;
continue;
}
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform",
+ NULL, "Operation not allowed",
NULL, NULL );
return -1;
/*
* if attr is objectClass, try to remap the value
*/
- if ( ava->aa_desc->ad_type->sat_oid
- == slap_schema.si_ad_objectClass->ad_type->sat_oid ) {
+ if ( ava->aa_desc == slap_schema.si_ad_objectClass ) {
ldap_back_map( &li->targets[ i ]->oc_map,
- &ava->aa_value, &mapped_value, 0 );
+ &ava->aa_value, &mapped_value,
+ BACKLDAP_MAP );
- if ( mapped_value.bv_val == NULL ) {
- lsc->candidate = META_NOT_CANDIDATE;
+ if ( mapped_value.bv_val == NULL || mapped_value.bv_val[0] == '\0' ) {
continue;
}
/*
*/
} else {
ldap_back_map( &li->targets[ i ]->at_map,
- &ava->aa_desc->ad_cname, &mapped_attr, 0 );
- if ( mapped_attr.bv_val == NULL ) {
- lsc->candidate = META_NOT_CANDIDATE;
+ &ava->aa_desc->ad_cname, &mapped_attr,
+ BACKLDAP_MAP );
+ if ( mapped_attr.bv_val == NULL || mapped_attr.bv_val[0] == '\0' ) {
continue;
}
}
*/
msgid[ i ] = ldap_compare( lc->conns[ i ].ld, mdn,
mapped_attr.bv_val, mapped_value.bv_val );
- if ( msgid[ i ] == -1 ) {
- lsc->candidate = META_NOT_CANDIDATE;
- continue;
- }
-
if ( mdn != dn->bv_val ) {
free( mdn );
}
free( mapped_value.bv_val );
}
+ if ( msgid[ i ] == -1 ) {
+ continue;
+ }
+
++candidates;
}
int lrc;
LDAPMessage *res = NULL;
- if ( lsc->candidate != META_CANDIDATE ) {
+ if ( msgid[ i ] == -1 ) {
continue;
}
last = i;
break;
}
- lsc->candidate = META_NOT_CANDIDATE;
+ msgid[ i ] = -1;
--candidates;
+
} else {
- lsc->candidate = META_NOT_CANDIDATE;
+ msgid[ i ] = -1;
--candidates;
if ( res ) {
ldap_msgfree( res );
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform",
+ NULL, "Operation not allowed",
NULL, NULL );
rc = -1;
goto cleanup;