mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-14 09:06:47 +00:00
PluginManager: Do not load built-in plugins via dlopen/dlsym
fixes #351
This commit is contained in:
parent
b328fb01af
commit
3d53f901d2
|
@ -200,7 +200,19 @@ auto fair::mq::PluginManager::LoadPluginStatic(const string& pluginName) -> void
|
||||||
// Load symbol
|
// Load symbol
|
||||||
if (fPluginFactories.find(pluginName) == fPluginFactories.end()) {
|
if (fPluginFactories.find(pluginName) == fPluginFactories.end()) {
|
||||||
try {
|
try {
|
||||||
|
if ("control" == pluginName) {
|
||||||
|
try {
|
||||||
|
fPluginProgOptions.insert({pluginName, plugins::ControlPluginProgramOptions().value()});
|
||||||
|
}
|
||||||
|
catch (const boost::bad_optional_access& e) { /* just ignore, if no prog options are declared */ }
|
||||||
|
} else if ("config" == pluginName) {
|
||||||
|
try {
|
||||||
|
fPluginProgOptions.insert({pluginName, plugins::ConfigPluginProgramOptions().value()});
|
||||||
|
}
|
||||||
|
catch (const boost::bad_optional_access& e) { /* just ignore, if no prog options are declared */ }
|
||||||
|
} else {
|
||||||
LoadSymbols(pluginName, dll::program_location());
|
LoadSymbols(pluginName, dll::program_location());
|
||||||
|
}
|
||||||
fPluginOrder.push_back(pluginName);
|
fPluginOrder.push_back(pluginName);
|
||||||
} catch (boost::system::system_error& e) {
|
} catch (boost::system::system_error& e) {
|
||||||
throw PluginLoadError(ToString("An error occurred while loading static plugin ", pluginName, ": ", e.what()));
|
throw PluginLoadError(ToString("An error occurred while loading static plugin ", pluginName, ": ", e.what()));
|
||||||
|
@ -211,9 +223,15 @@ auto fair::mq::PluginManager::LoadPluginStatic(const string& pluginName) -> void
|
||||||
auto fair::mq::PluginManager::InstantiatePlugin(const string& pluginName) -> void
|
auto fair::mq::PluginManager::InstantiatePlugin(const string& pluginName) -> void
|
||||||
{
|
{
|
||||||
if (fPlugins.find(pluginName) == fPlugins.end()) {
|
if (fPlugins.find(pluginName) == fPlugins.end()) {
|
||||||
|
if ("control" == pluginName) {
|
||||||
|
fPlugins[pluginName] = plugins::Make_control_Plugin(fPluginServices.get());
|
||||||
|
} else if ("config" == pluginName) {
|
||||||
|
fPlugins[pluginName] = plugins::Make_config_Plugin(fPluginServices.get());
|
||||||
|
} else {
|
||||||
fPlugins[pluginName] = fPluginFactories[pluginName](*fPluginServices);
|
fPlugins[pluginName] = fPluginFactories[pluginName](*fPluginServices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
auto fair::mq::PluginManager::InstantiatePlugins() -> void
|
auto fair::mq::PluginManager::InstantiatePlugins() -> void
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user