From a4a218b4ebe490a1d55132e5a19202ca675d393a Mon Sep 17 00:00:00 2001 From: vectinx Date: Mon, 27 Oct 2025 14:59:19 +0300 Subject: [PATCH] slapi-plugins: Add replication checking to the Modrdn plugin The Modrdn plugin doesn't check whether the operation it processes is replicated. This results in duplicate operations on each replica, for example, when deleting a saved user. To fix this behavior, a check was added to the Modrdn plugin that the operation is not replicated. Fixes: https://pagure.io/freeipa/issue/9867 Signed-off-by: vectinx Reviewed-By: Alexander Bokovoy --- daemons/ipa-slapi-plugins/ipa-modrdn/ipa_modrdn.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/daemons/ipa-slapi-plugins/ipa-modrdn/ipa_modrdn.c b/daemons/ipa-slapi-plugins/ipa-modrdn/ipa_modrdn.c index 8be192a5e..de980ec36 100644 --- a/daemons/ipa-slapi-plugins/ipa-modrdn/ipa_modrdn.c +++ b/daemons/ipa-slapi-plugins/ipa-modrdn/ipa_modrdn.c @@ -709,6 +709,7 @@ static int ipamodrdn_post_op(Slapi_PBlock *pb) Slapi_Attr *sattr = NULL; Slapi_Attr *tattr = NULL; int ret = LDAP_SUCCESS; + int is_repl_op; LOG_TRACE("--in-->\n"); @@ -717,6 +718,17 @@ static int ipamodrdn_post_op(Slapi_PBlock *pb) goto done; } + if (slapi_pblock_get(pb, SLAPI_IS_REPLICATED_OPERATION, &is_repl_op) != 0) { + LOG_FATAL("unable to retrieve replication operation status\n"); + ret = LDAP_OPERATIONS_ERROR; + goto done; + } + + /* pass through if this is a replicated operation */ + if (is_repl_op) { + goto done; + } + slapi_pblock_get(pb, SLAPI_ENTRY_POST_OP, &e); if (NULL == e) { goto done;