}
static int
-ldif_tool_entry_delete( BackendDB *be, ID id, struct berval *text )
+ldif_tool_entry_delete( BackendDB *be, struct berval *ndn, struct berval *text )
{
struct ldif_tool *tl = &((struct ldif_info *) be->be_private)->li_tool;
int rc = LDAP_SUCCESS;
const char *errmsg = NULL;
struct berval path;
- Entry *e;
Operation op = {0};
- id--;
- if ( id >= tl->ecount || tl->entries[id] == NULL )
- return LDAP_OTHER;
- e = tl->entries[id];
-
op.o_bd = be;
- ndn2path( &op, &e->e_nname, &path, 0 );
+ ndn2path( &op, ndn, &path, 0 );
ldif2dir_len( path );
ldif2dir_name( path );
}
SLAP_FREE( path.bv_val );
- entry_free( e );
- tl->entries[id] = NULL;
if ( errmsg == NULL && rc != LDAP_OTHER )
errmsg = ldap_err2string( rc );
typedef ID (BI_tool_dn2id_get) LDAP_P(( BackendDB *be, struct berval *dn ));
typedef ID (BI_tool_entry_modify) LDAP_P(( BackendDB *be, Entry *e,
struct berval *text ));
-typedef int (BI_tool_entry_delete) LDAP_P(( BackendDB *be, ID id,
+typedef int (BI_tool_entry_delete) LDAP_P(( BackendDB *be, struct berval *ndn,
struct berval *text ));
struct BackendInfo {
break;
case LDAP_REQ_DELETE:
- rc = be->be_entry_delete( be, id, &bvtext );
- e_orig = NULL;
+ rc = be->be_entry_delete( be, &ndn, &bvtext );
break;
}
if( rc != LDAP_SUCCESS ) {
fprintf( stderr, "%s: could not %s entry dn=\"%s\" "
- "(line=%lu): %s\n", progname, request, e->e_dn,
+ "(line=%lu): %s\n", progname, request, ndn.bv_val,
lineno, bvtext.bv_val );
rc = EXIT_FAILURE;
goto cleanup;
if ( verbose )
fprintf( stderr, "%s: \"%s\" (%08lx)\n",
- request, e->e_dn, (long) id );
+ request, ndn.bv_val, (long) id );
} else {
if ( verbose )
fprintf( stderr, "%s: \"%s\"\n",
- request, e->e_dn );
+ request, ndn.bv_val );
}
cleanup:;