This is an automated email from the git hooks/post-receive script.
tbordaz pushed a commit to branch 389-ds-base-1.3.6
in repository 389-ds-base.
commit 64ff8370622e097dd75f268f6730bc82916f619e
Author: Thierry Bordaz <tbordaz(a)redhat.com>
Date: Fri Apr 21 17:16:55 2017 +0200
Ticket 49230 - slapi_register_plugin creates config entry where it should not
Bug Description:
slapi-register-plugin systematically create an entry under
'cn=plugins,cn=config' because it is not taking into account
the flag 'add_entry in 'plugin_setup'.
This is potentially a regression introduced by
https://pagure.io/389-ds-base/issue/49066 (TBC)
Fix Description:
Test 'add_entry' before adding the entry
https://pagure.io/389-ds-base/issue/49230
Review by: Mark Reynolds, William Brown
---
ldap/servers/slapd/plugin.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/ldap/servers/slapd/plugin.c b/ldap/servers/slapd/plugin.c
index 77043ff..6131c4b 100644
--- a/ldap/servers/slapd/plugin.c
+++ b/ldap/servers/slapd/plugin.c
@@ -2848,7 +2848,7 @@ add_entry - if true, the entry will be added to the DIT using the
given
************************************/
int
plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group,
- slapi_plugin_init_fnptr p_initfunc, int add_entry __attribute__((unused)), char
*returntext)
+ slapi_plugin_init_fnptr p_initfunc, int add_entry, char *returntext)
{
int ii = 0;
char attrname[SLAPD_TYPICAL_ATTRIBUTE_NAME_MAX_LENGTH];
@@ -3142,11 +3142,13 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid
*group,
add_plugin_entry_dn(dn_copy);
}
- /* make a copy of the plugin entry for our own use because it will
- be freed later by the caller */
- Slapi_Entry *e_copy = slapi_entry_dup(plugin_entry);
- /* new_plugin_entry(&plugin_entries, plugin_entry, plugin); */
- new_plugin_entry(&dep_plugin_entries, e_copy, plugin);
+ if (add_entry) {
+ /* make a copy of the plugin entry for our own use because it will
+ be freed later by the caller */
+ Slapi_Entry *e_copy = slapi_entry_dup(plugin_entry);
+ /* new_plugin_entry(&plugin_entries, plugin_entry, plugin); */
+ new_plugin_entry(&dep_plugin_entries, e_copy, plugin);
+ }
PLUGIN_CLEANUP:
if (status) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.