ldap/servers/plugins/mep/mep.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
New commits:
commit 42fd02cefd7ae7e27fd6a6f06a80e2329b23cd3b
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Mon Feb 21 14:44:46 2011 -0800
Bug 678646 - Ignore tombstone operations in managed entry plug-in
The managed entry plug-in currently doesn't ignore operations tombstone
entries. If one is using replication and deletes an origin entry, then
re-adds an origin entry with the same name, the associated managed entry
will be deleted when the tombstone is cleaned up. This results in an
origin entry with no associated managed entry.
This patch makes the managed entry delete post-op skip processing for
tombstone entries.
diff --git a/ldap/servers/plugins/mep/mep.c b/ldap/servers/plugins/mep/mep.c
index 5ecc815..cc4be8e 100644
--- a/ldap/servers/plugins/mep/mep.c
+++ b/ldap/servers/plugins/mep/mep.c
@@ -2008,6 +2008,12 @@ mep_mod_post_op(Slapi_PBlock *pb)
goto bail;
}
+ /* If the entry is a tombstone, just bail. */
+ if (slapi_entry_attr_hasvalue(e, SLAPI_ATTR_OBJECTCLASS,
+ SLAPI_ATTR_VALUE_TOMBSTONE)) {
+ goto bail;
+ }
+
/* Check if we're an origin entry. Update the
* mapped attrs of it's managed entry if so. */
managed_dn = slapi_entry_attr_get_charptr(e, MEP_MANAGED_ENTRY_TYPE);
@@ -2108,6 +2114,12 @@ mep_add_post_op(Slapi_PBlock *pb)
slapi_pblock_get(pb, SLAPI_ENTRY_POST_OP, &e);
if (e) {
+ /* If the entry is a tombstone, just bail. */
+ if (slapi_entry_attr_hasvalue(e, SLAPI_ATTR_OBJECTCLASS,
+ SLAPI_ATTR_VALUE_TOMBSTONE)) {
+ return 0;
+ }
+
/* Check if a config entry applies
* to the entry being added. */
mep_config_read_lock();
@@ -2164,6 +2176,12 @@ mep_del_post_op(Slapi_PBlock *pb)
if (e) {
char *managed_dn = NULL;
+ /* If the entry is a tombstone, just bail. */
+ if (slapi_entry_attr_hasvalue(e, SLAPI_ATTR_OBJECTCLASS,
+ SLAPI_ATTR_VALUE_TOMBSTONE)) {
+ return 0;
+ }
+
/* See if we're an origin entry . */
managed_dn = slapi_entry_attr_get_charptr(e, MEP_MANAGED_ENTRY_TYPE);
if (managed_dn) {
@@ -2236,6 +2254,12 @@ mep_modrdn_post_op(Slapi_PBlock *pb)
return 0;
}
+ /* If the entry is a tombstone, just bail. */
+ if (slapi_entry_attr_hasvalue(post_e, SLAPI_ATTR_OBJECTCLASS,
+ SLAPI_ATTR_VALUE_TOMBSTONE)) {
+ return 0;
+ }
+
/* See if we're an origin entry . */
managed_dn = slapi_entry_attr_get_charptr(post_e, MEP_MANAGED_ENTRY_TYPE);
if (managed_dn) {
Show replies by date