VERSION.sh | 2 +-
ldap/servers/slapd/back-ldbm/ldbm_delete.c | 17 ++++++++++++-----
2 files changed, 13 insertions(+), 6 deletions(-)
New commits:
commit 6041d86d1df10cf72c6d26bcf5b21d8168cdb640
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Sat May 5 08:18:58 2012 -0600
bump version to 1.2.11.3
diff --git a/VERSION.sh b/VERSION.sh
index 67b5ea0..673f16b 100644
--- a/VERSION.sh
+++ b/VERSION.sh
@@ -10,7 +10,7 @@ vendor="389 Project"
# PACKAGE_VERSION is constructed from these
VERSION_MAJOR=1
VERSION_MINOR=2
-VERSION_MAINT=11.2
+VERSION_MAINT=11.3
# if this is a PRERELEASE, set VERSION_PREREL
# otherwise, comment it out
# be sure to include the dot prefix in the prerel
commit 314ea64024def55b2d900f306ea7de30a00a70c5
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Fri May 4 20:52:30 2012 -0600
Ticket #358 - managed entry doesn't delete linked entry
https://fedorahosted.org/389/ticket/358
Resolves: Ticket #358
Bug Description: managed entry doesn't delete linked entry
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: SLAPI_DELETE_BEPREOP_ENTRY is the same as SLAPI_ENTRY_PRE_OP
they are the same field in the pblock. We have to be very careful to only
set SLAPI_DELETE_BEPREOP_ENTRY for those plugins which absolutely need to
use it, and be careful to reset it after use. We must not overwrite the
SLAPI_ENTRY_PRE_OP which is needed by postoperation plugins.
Platforms tested: RHEL6 x86_64, Fedora 17
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index 569ad0b..57a4605 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -106,7 +106,6 @@ ldbm_back_delete( Slapi_PBlock *pb )
slapi_pblock_get( pb, SLAPI_TXN, (void**)&parent_txn );
slapi_pblock_get( pb, SLAPI_OPERATION, &operation );
slapi_pblock_get( pb, SLAPI_IS_REPLICATED_OPERATION, &is_replicated_operation );
- slapi_pblock_get( pb, SLAPI_DELETE_BEPREOP_ENTRY, &orig_entry );
/* sdn needs to be initialized before "goto *_return */
slapi_sdn_init(&sdn);
@@ -216,9 +215,6 @@ ldbm_back_delete( Slapi_PBlock *pb )
}
slapi_pblock_set(pb, SLAPI_RESULT_CODE, &ldap_result_code);
- /* set entry in case be-preop plugins need to work on it (e.g., USN) */
- slapi_pblock_set( pb, SLAPI_DELETE_BEPREOP_ENTRY, e->ep_entry );
-
rc = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_PRE_DELETE_FN);
if (rc == -1)
{
@@ -503,6 +499,7 @@ ldbm_back_delete( Slapi_PBlock *pb )
/* call the transaction pre delete plugins just after creating
* the transaction */
+ slapi_pblock_get( pb, SLAPI_DELETE_BEPREOP_ENTRY, &orig_entry );
slapi_pblock_set( pb, SLAPI_DELETE_BEPREOP_ENTRY, e->ep_entry );
retval = plugin_call_plugins(pb, SLAPI_PLUGIN_BE_TXN_PRE_DELETE_FN);
if (retval) {
@@ -522,10 +519,13 @@ ldbm_back_delete( Slapi_PBlock *pb )
}
goto error_return;
}
+ slapi_pblock_set( pb, SLAPI_DELETE_BEPREOP_ENTRY, orig_entry );
+ orig_entry = NULL;
if(create_tombstone_entry)
{
+ slapi_pblock_get( pb, SLAPI_DELETE_BEPREOP_ENTRY, &orig_entry );
slapi_pblock_set( pb, SLAPI_DELETE_BEPREOP_ENTRY,
tombstone->ep_entry );
rc = plugin_call_plugins(pb,
@@ -549,6 +549,8 @@ ldbm_back_delete( Slapi_PBlock *pb )
/* retval is -1 */
goto error_return;
}
+ slapi_pblock_set( pb, SLAPI_DELETE_BEPREOP_ENTRY, orig_entry );
+ orig_entry = NULL;
/*
* The entry is not removed from the disk when we tombstone an
@@ -1097,7 +1099,12 @@ error_return:
}
common_return:
- slapi_pblock_set( pb, SLAPI_DELETE_BEPREOP_ENTRY, orig_entry );
+ if (orig_entry) {
+ /* NOTE: #define SLAPI_DELETE_BEPREOP_ENTRY SLAPI_ENTRY_PRE_OP */
+ /* so if orig_entry is NULL, we will wipe out SLAPI_ENTRY_PRE_OP
+ for the post op plugins */
+ slapi_pblock_set( pb, SLAPI_DELETE_BEPREOP_ENTRY, orig_entry );
+ }
if (tombstone_in_cache)
{
CACHE_RETURN( &inst->inst_cache, &tombstone );