Commit 8b8890bd authored by Ondřej Kuzník's avatar Ondřej Kuzník Committed by Howard Chu
Browse files

ITS#8215 Change BI_tool_entry_delete signature

parent 6f1544c5
......@@ -1891,22 +1891,16 @@ ldif_tool_entry_modify( BackendDB *be, Entry *e, struct berval *text )
}
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 );
......@@ -1937,8 +1931,6 @@ ldif_tool_entry_delete( BackendDB *be, ID id, struct berval *text )
}
SLAP_FREE( path.bv_val );
entry_free( e );
tl->entries[id] = NULL;
if ( errmsg == NULL && rc != LDAP_OTHER )
errmsg = ldap_err2string( rc );
......
......@@ -2209,7 +2209,7 @@ typedef int (BI_tool_sync) LDAP_P(( BackendDB *be ));
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 {
......
......@@ -564,15 +564,14 @@ slapmodify( int argc, char **argv )
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;
......@@ -582,11 +581,11 @@ slapmodify( int argc, char **argv )
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:;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment