X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-ldif%2Fldif.c;h=3d4c88dac6a8ee9feb11a67b30998f0ab1ceecdb;hb=59e9ff6243465640956b58ad1756a3ede53eca7c;hp=116b9f7cd5892a801eb3a52c81e2d55b8e0091c1;hpb=bd1068204dff009e381ea89c362ed82088fd2011;p=openldap diff --git a/servers/slapd/back-ldif/ldif.c b/servers/slapd/back-ldif/ldif.c index 116b9f7cd5..3d4c88dac6 100644 --- a/servers/slapd/back-ldif/ldif.c +++ b/servers/slapd/back-ldif/ldif.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * 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 );