Bug 450742
Summary: | server should pass in config entry to plugin init function | ||
---|---|---|---|
Product: | [Retired] 389 | Reporter: | Nalin Dahyabhai <nalin> |
Component: | Server - Plugins | Assignee: | Rich Megginson <rmeggins> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Ben Levenson <benl> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 1.1.1 | CC: | jgalipea, nhosoi |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-12-10 18:37:34 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 743970 |
Description
Nalin Dahyabhai
2008-06-10 19:11:38 UTC
In a plugin start function, the plugin receives the plugin config entry in the pblock parameter SLAPI_ADD_ENTRY e.g. from pam_passthru: static int pam_passthru_bindpreop_start( Slapi_PBlock *pb ) { int rc; Slapi_Entry *config_e = NULL; /* entry containing plugin config */ PAM_PASSTHRU_ASSERT( pb != NULL ); slapi_log_error( SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "=> pam_passthru_bindpreop_start\n" ); if ( slapi_pblock_get( pb, SLAPI_ADD_ENTRY, &config_e ) != 0 ) { slapi_log_error( SLAPI_LOG_FATAL, PAM_PASSTHRU_PLUGIN_SUBSYSTEM, "missing config entry\n" ); return( -1 ); } /* process config using config_e */ We should do the same for plugin init, for those cases where the plugin must have access to its config during the init phase. Upstream ticket: https://fedorahosted.org/389/ticket/120 fixed commit b6d3ba77683722ed8b88994a637ba64fa18e57a1 Author: Rich Megginson <rmeggins> Date: Wed Oct 5 16:53:30 2011 -0600 pass the plugin config entry to the plugin init function A plugin init function can get the plugin config entry (that is, its own config entry) by using the pblock parameter SLAPI_PLUGIN_CONFIG_ENTRY int my_plugin_init(Slapi_PBlock *pb) { Slapi_Entry *my_config_entry = NULL; slapi_pblock_get(pb, SLAPI_PLUGIN_CONFIG_ENTRY, &my_config_entry); Reviewed by: nkinder, nhosoi (Thanks!) |