From: Kurt Zeilenga Date: Sat, 31 Jul 1999 03:37:40 +0000 (+0000) Subject: Experimental fix to ITS#179 fix. X-Git-Tag: TWEB_OL_BASE~353 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6fb50094d82f1112de7c1830ded95a22c1009ed9;p=openldap Experimental fix to ITS#179 fix. --- diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index 75154c3cf9..1fe1a19ac3 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -115,15 +115,7 @@ int ldbm_modify_internal( } ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex ); - /* modify indexes */ - if ( index_add_mods( be, modlist, e->e_id ) != 0 ) { - attrs_free( e->e_attrs ); - e->e_attrs = save_attrs; - send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, - NULL, NULL, NULL, NULL ); - return -1; - } - + /* remove old indices */ if( save_attrs != NULL ) { for ( ml = modlist; ml != NULL; ml = ml->ml_next ) { mod = &ml->ml_mod; @@ -145,6 +137,14 @@ int ldbm_modify_internal( attrs_free( save_attrs ); } + /* modify indexes */ + if ( index_add_mods( be, modlist, e->e_id ) != 0 ) { + /* our indices are likely hosed */ + send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, + NULL, NULL, NULL, NULL ); + return -1; + } + /* check for abandon */ ldap_pvt_thread_mutex_lock( &op->o_abandonmutex ); if ( op->o_abandon ) {