mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
prevent operation on tombstones
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
parent
fcb9854dcb
commit
102651b10a
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user