From 6e09835b2b5b221f285f1bd6d61978d0a77843bd Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Tue, 7 Oct 2014 12:12:28 -0700 Subject: [PATCH 18/21] Ticket #47919 - ldbm_back_modify SLAPI_PLUGIN_BE_PRE_MODIFY_FN does not return even if one of the preop plugins fails. Bug Description: In ldbm_back_modify, if one of the be_preop plugins called at SLAPI_PLUGIN_BE_PRE_MODIFY_FN fail, ldbm_back_modify does not return there but go to the real modify operation. Fix Description: If an error is returned from be_preop plugins in ldbm_back_modify, it returns the error there and does not proceed the modify operation. https://fedorahosted.org/389/ticket/47919 Reviewed by mreynolds@redhat.com (Thank you, Mark!!) (cherry picked from commit cb173814ec579fafbfef515738c16a986a9749cd) (cherry picked from commit 17294432e95bdb30c6816cefa7be5035df818a43) --- ldap/servers/slapd/back-ldbm/ldbm_modify.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modify.c b/ldap/servers/slapd/back-ldbm/ldbm_modify.c index 529bd32..d15b050 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_modify.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_modify.c @@ -641,11 +641,11 @@ ldbm_back_modify( Slapi_PBlock *pb ) if (SLAPI_PLUGIN_NOOP == opreturn) { not_an_error = 1; rc = opreturn = LDAP_SUCCESS; - goto error_return; } else if (!opreturn) { - opreturn = -1; + opreturn = SLAPI_PLUGIN_FAILURE; slapi_pblock_set(pb, SLAPI_PLUGIN_OPRETURN, &opreturn); } + goto error_return; } /* The Plugin may have messed about with some of the PBlock parameters... ie. mods */ slapi_pblock_get( pb, SLAPI_MODIFY_MODS, &mods ); -- 1.9.3