summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2010-04-14 10:15:53 -0600
committerRich Megginson <rmeggins@redhat.com>2010-04-14 10:19:17 -0600
commitc15e10b50189d384436728be9ee17986225882c8 (patch)
treecec6aa8e1d1d8d47bf6ea770447fbe938d75060b
parent92ca2bbfa7a3462b9e4317b0fdb6828f60612021 (diff)
downloadds-c15e10b50189d384436728be9ee17986225882c8.tar.gz
ds-c15e10b50189d384436728be9ee17986225882c8.tar.xz
ds-c15e10b50189d384436728be9ee17986225882c8.zip
Bug 576644 - segfault while multimaster replication (paired node won't find deleted entries)
https://bugzilla.redhat.com/show_bug.cgi?id=576644 Resolves: bug 576644 Bug Description: segfault while multimaster replication (paired node won't find deleted entries) Reviewed by: rmeggins Fixed by: edewata, nhosoi Branch: Directory_Server_8_2_Branch Fix Description: The delete code stores the actual entry from the entry cache in the pblock as SLAPI_DELETE_BEPREOP_ENTRY so that the be preop plugins can have access to the entry. SLAPI_DELETE_BEPREOP_ENTRY is an alias for SLAPI_ENTRY_PRE_OP which is used by the front-end delete code. When processing a replicated delete operation, and the entry has already been deleted (converted to a tombstone), we needed to restore the original entry in SLAPI_DELETE_BEPREOP_ENTRY so that the front-end code can free it as SLAPI_ENTRY_PRE_OP instead of freeing the actual entry from the cache. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no (cherry picked from commit e50dceb45a2ddffe749b444fa057d93776f882c9)
-rw-r--r--ldap/servers/slapd/back-ldbm/ldbm_delete.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index c1cb1cf8..e862311e 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -189,6 +189,8 @@ ldbm_back_delete( Slapi_PBlock *pb )
if(ldap_result_code==LDAP_OPERATIONS_ERROR ||
ldap_result_code==LDAP_INVALID_DN_SYNTAX)
{
+ /* restore original entry so the front-end delete code can free it */
+ slapi_pblock_set( pb, SLAPI_DELETE_BEPREOP_ENTRY, orig_entry );
goto error_return;
}
slapi_pblock_set(pb, SLAPI_RESULT_CODE, &ldap_result_code);
@@ -204,6 +206,8 @@ ldbm_back_delete( Slapi_PBlock *pb )
* or that this Operation became a No-Op.
*/
slapi_pblock_get(pb, SLAPI_RESULT_CODE, &ldap_result_code);
+ /* restore original entry so the front-end delete code can free it */
+ slapi_pblock_set( pb, SLAPI_DELETE_BEPREOP_ENTRY, orig_entry );
goto error_return;
}
/* the flag could be set in a preop plugin (e.g., USN) */