]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldif/ldif.c
Happy New Year
[openldap] / servers / slapd / back-ldif / ldif.c
index 116b9f7cd5892a801eb3a52c81e2d55b8e0091c1..3d4c88dac6a8ee9feb11a67b30998f0ab1ceecdb 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2005-2015 The OpenLDAP Foundation.
+ * Copyright 2005-2018 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -395,7 +395,6 @@ crc32(const void *vbuf, int len)
 {
        const unsigned char     *buf = vbuf;
        ber_uint_t              crc = 0xffffffff;
-       int                             i;
 
        while (len > 7) {
                CRC8;
@@ -1891,22 +1890,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 +1930,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 );