From c20f4689d1abd1246870ad2281576b2f7483c921 Mon Sep 17 00:00:00 2001 From: "Thierry bordaz (tbordaz)" Date: Wed, 19 Feb 2014 17:03:03 +0100 Subject: [PATCH] Ticket ticket47699: Propagate plugin precedence to all registered function types Bug Description: A plugin can define its nsslapd-pluginprecedence (config), that is number that order the plugins in the plugin list. If a plugin register an other plugin (slapi_register_plugin), this number is not preserved in the new plugin and it gets a default plugin precedence value. Fix Description: When registering a plugin (slapi_register_plugin) a plugin identity is provided that contains the original plugin configuration (with its precedence). The fix consist to set the precedence to the value store in the plugin identity https://fedorahosted.org/389/ticket/47699 Reviewed by: ? Platforms tested: Flag Day: no Doc impact: no --- ldap/servers/slapd/plugin.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ldap/servers/slapd/plugin.c b/ldap/servers/slapd/plugin.c index 617909d..9e37e7b 100644 --- a/ldap/servers/slapd/plugin.c +++ b/ldap/servers/slapd/plugin.c @@ -2226,6 +2226,16 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group, } slapi_ch_free((void**)&value); } + /* If the plugin belong to a group, get the precedence from the group */ + if (group) { + struct slapi_componentid * cid = (struct slapi_componentid *) group; + if (cid->sci_plugin && + (cid->sci_plugin->plg_precedence != PLUGIN_DEFAULT_PRECEDENCE) && + (cid->sci_plugin->plg_precedence >= PLUGIN_MIN_PRECEDENCE) && + (cid->sci_plugin->plg_precedence <= PLUGIN_MAX_PRECEDENCE)) { + plugin->plg_precedence = cid->sci_plugin->plg_precedence; + } + } if (!(value = slapi_entry_attr_get_charptr(plugin_entry, ATTR_PLUGIN_INITFN))) -- 1.7.11.7