Blame SOURCES/0001-Issue-51076-prevent-unnecessarily-duplication-of-the.patch

d69b2b
From 97ecf0190f264a2d87750bc2d26ebf011542e3e1 Mon Sep 17 00:00:00 2001
d69b2b
From: Mark Reynolds <mreynolds@redhat.com>
d69b2b
Date: Fri, 8 May 2020 10:52:43 -0400
d69b2b
Subject: [PATCH 01/12] Issue 51076 - prevent unnecessarily duplication of the
d69b2b
 target entry
d69b2b
d69b2b
Bug Description:  For any update operation the MEP plugin was calling
d69b2b
                  slapi_search_internal_get_entry() which duplicates
d69b2b
                  the entry it returns.  In this case the entry is just
d69b2b
                  read from and discarded, but this entry is already
d69b2b
                  in the pblock (the PRE OP ENTRY).
d69b2b
d69b2b
Fix Description:  Just grab the PRE OP ENTRY from the pblock and use
d69b2b
                  that to read the attribute values from.  This saves
d69b2b
                  two entry duplications for every update operation
d69b2b
                  from MEP.
d69b2b
d69b2b
fixes:  https://pagure.io/389-ds-base/issue/51076
d69b2b
d69b2b
Reviewed by: tbordaz & firstyear(Thanks!!)
d69b2b
---
d69b2b
 ldap/servers/plugins/mep/mep.c | 5 ++---
d69b2b
 1 file changed, 2 insertions(+), 3 deletions(-)
d69b2b
d69b2b
diff --git a/ldap/servers/plugins/mep/mep.c b/ldap/servers/plugins/mep/mep.c
d69b2b
index ca9a64b3b..401d95e3a 100644
d69b2b
--- a/ldap/servers/plugins/mep/mep.c
d69b2b
+++ b/ldap/servers/plugins/mep/mep.c
d69b2b
@@ -2165,9 +2165,8 @@ mep_pre_op(Slapi_PBlock *pb, int modop)
d69b2b
                 if (e && free_entry) {
d69b2b
                     slapi_entry_free(e);
d69b2b
                 }
d69b2b
-
d69b2b
-                slapi_search_internal_get_entry(sdn, 0, &e, mep_get_plugin_id());
d69b2b
-                free_entry = 1;
d69b2b
+                slapi_pblock_get(pb, SLAPI_ENTRY_PRE_OP, &e);
d69b2b
+                free_entry = 0;
d69b2b
             }
d69b2b
 
d69b2b
             if (e && mep_is_managed_entry(e)) {
d69b2b
-- 
d69b2b
2.26.2
d69b2b