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