소스 검색

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.
Nathan Kinder 14 년 전
부모
커밋
59209af331
1개의 변경된 파일24개의 추가작업 그리고 0개의 파일을 삭제
  1. 24 0
      ldap/servers/plugins/mep/mep.c

+ 24 - 0
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) {