/*
- * 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
)
{
struct metainfo *li = ( struct metainfo * )be->be_private;
lc = meta_back_getconn( li, conn, op, META_OP_REQUIRE_SINGLE,
ndn, &candidate );
- if ( !lc || !meta_back_dobind( lc, op ) ) {
+ if ( !lc || !meta_back_dobind( lc, op ) || !meta_back_is_valid( lc, candidate ) ) {
+ send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
+ NULL, NULL, NULL, NULL );
return -1;
}
* Rewrite the compare dn, if needed
*/
switch ( rewrite_session( li->targets[ candidate ]->rwinfo,
- "deleteDn", dn, conn, &mdn ) ) {
+ "deleteDn", 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] deleteDn: \"%s\" -> \"%s\"\n",
- dn, mdn ));
+ LDAP_LOG( BACK_META, DETAIL1,
+ "[rw] deleteDn: \"%s\" -> \"%s\"\n", dn->bv_val, mdn, 0 );
#else /* !NEW_LOGGING */
Debug( LDAP_DEBUG_ARGS, "rw> deleteDn: \"%s\" -> \"%s\"\n%s",
- dn, mdn, "" );
+ dn->bv_val, mdn, "" );
#endif /* !NEW_LOGGING */
break;
case REWRITE_REGEXEC_UNWILLING:
send_ldap_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
- NULL, "Unwilling to perform", NULL, NULL );
+ NULL, NULL, NULL, NULL );
return -1;
case REWRITE_REGEXEC_ERR:
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR,
- NULL, "Operations error", NULL, NULL );
+ NULL, NULL, NULL, NULL );
return -1;
}
ldap_delete_s( lc->conns[ candidate ]->ld, mdn );
- if ( mdn != dn ) {
+ if ( mdn != dn->bv_val ) {
free( mdn );
}