]> git.sur5r.net Git - openldap/commitdiff
ITS#8215 Change BI_tool_entry_delete signature
authorOndřej Kuzník <ondra@mistotebe.net>
Tue, 11 Aug 2015 12:30:47 +0000 (14:30 +0200)
committerHoward Chu <hyc@openldap.org>
Sun, 25 Oct 2015 09:02:59 +0000 (09:02 +0000)
servers/slapd/back-ldif/ldif.c
servers/slapd/slap.h
servers/slapd/slapmodify.c

index 116b9f7cd5892a801eb3a52c81e2d55b8e0091c1..ef9131d5bb76e8ed3ae695aa7333a4d9f7213323 100644 (file)
@@ -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 );
index b7dc833da086f5f57a80da85b49f0b3ba10854c5..f14015aeee41696a6935fec8592aefe937e39b21 100644 (file)
@@ -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 {
index 5ceec3e210b6facf9d3704eef318a04e6bbb8320..7a021b77322b4cab8c65d38e3509d6130037bf9b 100644 (file)
@@ -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:;