Blame SOURCES/0031-Ticket-49230-slapi_register_plugin-creates-config-en.patch

61f723
From 91a162d66c2fe239c009f1ee16974d310b333e7e Mon Sep 17 00:00:00 2001
61f723
From: Thierry Bordaz <tbordaz@redhat.com>
61f723
Date: Fri, 21 Apr 2017 17:16:55 +0200
61f723
Subject: [PATCH] Ticket 49230 - slapi_register_plugin creates config entry
61f723
 where it should not
61f723
61f723
Bug Description:
61f723
    slapi-register-plugin systematically create an entry under
61f723
    'cn=plugins,cn=config' because it is not taking into account
61f723
    the flag 'add_entry in 'plugin_setup'.
61f723
61f723
    This is potentially a regression introduced by
61f723
    https://pagure.io/389-ds-base/issue/49066 (TBC)
61f723
61f723
Fix Description:
61f723
    Test 'add_entry' before adding the entry
61f723
61f723
    https://pagure.io/389-ds-base/issue/49230
61f723
61f723
Review by: Mark Reynolds, William Brown
61f723
---
61f723
 ldap/servers/slapd/plugin.c | 12 +++++++-----
61f723
 1 file changed, 7 insertions(+), 5 deletions(-)
61f723
61f723
diff --git a/ldap/servers/slapd/plugin.c b/ldap/servers/slapd/plugin.c
61f723
index ac8306f..a5e0724 100644
61f723
--- a/ldap/servers/slapd/plugin.c
61f723
+++ b/ldap/servers/slapd/plugin.c
61f723
@@ -3132,11 +3132,13 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group,
61f723
 		add_plugin_entry_dn(dn_copy);
61f723
 	}
61f723
 
61f723
-    /* make a copy of the plugin entry for our own use because it will
61f723
-       be freed later by the caller */
61f723
-    Slapi_Entry *e_copy = slapi_entry_dup(plugin_entry);
61f723
-    /* new_plugin_entry(&plugin_entries, plugin_entry, plugin); */
61f723
-    new_plugin_entry(&dep_plugin_entries, e_copy, plugin);
61f723
+	if (add_entry) {
61f723
+		/* make a copy of the plugin entry for our own use because it will
61f723
+		   be freed later by the caller */
61f723
+		Slapi_Entry *e_copy = slapi_entry_dup(plugin_entry);
61f723
+		/* new_plugin_entry(&plugin_entries, plugin_entry, plugin); */
61f723
+		new_plugin_entry(&dep_plugin_entries, e_copy, plugin);
61f723
+	}
61f723
 
61f723
 PLUGIN_CLEANUP:
61f723
 	if (status) {
61f723
-- 
61f723
2.9.3
61f723