From f3a682c1ffc86ca5acaf02920ea60d5335590735 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 21 Oct 2011 14:07:42 +0200 Subject: [PATCH] starter: Load plugins specific to starter. --- configure.in | 2 ++ src/starter/Makefile.am | 1 + src/starter/starter.c | 8 ++++++++ 3 files changed, 11 insertions(+) diff --git a/configure.in b/configure.in index 6db827658..abde2876d 100644 --- a/configure.in +++ b/configure.in @@ -752,6 +752,7 @@ m4_include(m4/macros/add-plugin.m4) # plugin lists for all components libcharon_plugins= pluto_plugins= +starter_plugins= pool_plugins= openac_plugins= scepclient_plugins= @@ -860,6 +861,7 @@ ADD_PLUGIN([unit-tester], [c libcharon]) AC_SUBST(libcharon_plugins) AC_SUBST(pluto_plugins) +AC_SUBST(starter_plugins) AC_SUBST(pool_plugins) AC_SUBST(openac_plugins) AC_SUBST(scepclient_plugins) diff --git a/src/starter/Makefile.am b/src/starter/Makefile.am index 6f7f2882b..c51289832 100644 --- a/src/starter/Makefile.am +++ b/src/starter/Makefile.am @@ -22,6 +22,7 @@ AM_CFLAGS = \ -DIPSEC_EAPDIR=\"${eapdir}\" \ -DDEV_RANDOM=\"${random_device}\" \ -DDEV_URANDOM=\"${urandom_device}\" \ +-DPLUGINS=\""${starter_plugins}\"" \ -DDEBUG AM_YFLAGS = -v -d diff --git a/src/starter/starter.c b/src/starter/starter.c index 5cf842fe3..db3ca43c8 100644 --- a/src/starter/starter.c +++ b/src/starter/starter.c @@ -465,6 +465,13 @@ int main (int argc, char **argv) } } + /* load plugins */ + if (!lib->plugins->load(lib->plugins, NULL, + lib->settings->get_str(lib->settings, "starter.load", PLUGINS))) + { + exit(LSB_RC_FAILURE); + } + for (;;) { /* @@ -484,6 +491,7 @@ int main (int argc, char **argv) confread_free(cfg); unlink(STARTER_PID_FILE); plog("ipsec starter stopped"); + lib->plugins->unload(lib->plugins); close_log(); exit(LSB_RC_SUCCESS); }