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