prevent operation on tombstones

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Ludwig Krispenz 2015-09-02 15:40:38 +02:00 committed by Jan Cholasta
parent fcb9854dcb
commit 102651b10a
4 changed files with 22 additions and 1 deletions

View File

@ -289,6 +289,7 @@ void ipa_topo_util_update_host(Slapi_Entry *hostentry, LDAPMod **mods);
void ipa_topo_util_disable_repl_from_host(char *repl_root, char *delhost);
void ipa_topo_util_delete_segments_for_host(char *repl_root, char *delhost);
int ipa_topo_util_is_tombstone_op(Slapi_PBlock *pb);
int ipa_topo_util_entry_is_candidate(Slapi_Entry *e);
int ipa_topo_util_target_is_managed(Slapi_Entry *e);
int ipa_topo_util_segment_is_managed(TopoReplica *tconf, TopoReplicaSegment *tsegm);

View File

@ -214,6 +214,9 @@ ipa_topo_post_del(Slapi_PBlock *pb)
slapi_log_error(SLAPI_LOG_PLUGIN, IPA_TOPO_PLUGIN_SUBSYSTEM,
"--> ipa_topo_post_del\n");
/* 0. prevent operation on tombstones */
if (ipa_topo_util_is_tombstone_op(pb)) return 0;
/* 1. get entry */
slapi_pblock_get(pb,SLAPI_ENTRY_PRE_OP,&del_entry);

View File

@ -582,7 +582,8 @@ ipa_topo_pre_del(Slapi_PBlock *pb)
return 0;
}
if (ipa_topo_pre_ignore_op(pb)) return result;
if (ipa_topo_pre_ignore_op(pb) ||
ipa_topo_util_is_tombstone_op(pb)) return result;
if (ipa_topo_is_entry_managed(pb)) {
int rc = LDAP_UNWILLING_TO_PERFORM;

View File

@ -474,7 +474,10 @@ ipa_topo_util_conf_from_entry(Slapi_Entry *entry)
{
TopoReplica *conf = NULL;
char *repl_root = NULL;
repl_root = slapi_entry_attr_get_charptr(entry,"ipaReplTopoConfRoot");
if (NULL == repl_root) return NULL;
conf = ipa_topo_cfg_replica_find(repl_root, 1);
if (conf) {
slapi_ch_free((void **)&repl_root);
@ -1763,3 +1766,16 @@ ipa_topo_util_suffix_update(Slapi_Entry *config_post, Slapi_Entry *config_pre,
LDAPMod **mods)
{
}
#ifndef SLAPI_OP_FLAG_TOMBSTONE_ENTRY
#define SLAPI_OP_FLAG_TOMBSTONE_ENTRY 0x001000
#endif
int
ipa_topo_util_is_tombstone_op(Slapi_PBlock *pb)
{
Slapi_Operation *op;
slapi_pblock_get(pb, SLAPI_OPERATION, &op);
return slapi_operation_is_flag_set(op, SLAPI_OP_FLAG_TOMBSTONE_ENTRY);
}