settings: Use strongswan.conf used during library initialization for reload
authorMartin Willi <martin@revosec.ch>
Thu, 17 Jul 2014 16:07:05 +0000 (18:07 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 22 Sep 2014 11:40:39 +0000 (13:40 +0200)
Since 4b670a20 we require an explicit strongswan.conf to re-load configurations.
However, the define was missing in the build, breaking SIGHUP based config
reloading.

Fixes #651.

src/charon-cmd/charon-cmd.c
src/charon/charon.c
src/libhydra/Makefile.am
src/libstrongswan/settings/settings_parser.y

index b41cf46..6f2b6f1 100644 (file)
@@ -126,15 +126,12 @@ static int run()
                        {
                                DBG1(DBG_DMN, "signal of type SIGHUP received. Reloading "
                                         "configuration");
-#ifdef STRONGSWAN_CONF
-                               if (lib->settings->load_files(lib->settings, STRONGSWAN_CONF,
-                                                                                         FALSE))
+                               if (lib->settings->load_files(lib->settings, lib->conf, FALSE))
                                {
                                        charon->load_loggers(charon, levels, TRUE);
                                        lib->plugins->reload(lib->plugins, NULL);
                                }
                                else
-#endif
                                {
                                        DBG1(DBG_DMN, "reloading config failed, keeping old");
                                }
index 8afac3f..081e494 100644 (file)
@@ -124,15 +124,12 @@ static void run()
                        {
                                DBG1(DBG_DMN, "signal of type SIGHUP received. Reloading "
                                         "configuration");
-#ifdef STRONGSWAN_CONF
-                               if (lib->settings->load_files(lib->settings, STRONGSWAN_CONF,
-                                                                                         FALSE))
+                               if (lib->settings->load_files(lib->settings, lib->conf, FALSE))
                                {
                                        charon->load_loggers(charon, levels, !use_syslog);
                                        lib->plugins->reload(lib->plugins, NULL);
                                }
                                else
-#endif
                                {
                                        DBG1(DBG_DMN, "reloading config failed, keeping old");
                                }
@@ -468,4 +465,3 @@ deinit:
        library_deinit();
        return status;
 }
-
index 0c8ecda..510f2a1 100644 (file)
@@ -21,8 +21,7 @@ endif
 AM_CPPFLAGS = \
        -I$(top_srcdir)/src/libstrongswan \
        -DIPSEC_DIR=\"${ipsecdir}\" \
-       -DPLUGINDIR=\"${plugindir}\" \
-       -DSTRONGSWAN_CONF=\"${strongswan_conf}\"
+       -DPLUGINDIR=\"${plugindir}\"
 
 AM_LDFLAGS = \
   -no-undefined
index b79faf6..d95a24b 100644 (file)
@@ -259,13 +259,11 @@ bool settings_parser_parse_file(section_t *root, char *name)
        helper->file_include(helper, name);
        if (!settings_parser_open_next_file(helper))
        {
-#ifdef STRONGSWAN_CONF
-               if (streq(name, STRONGSWAN_CONF))
+               if (lib->conf && streq(name, lib->conf))
                {
                        DBG2(DBG_CFG, "failed to open config file '%s'", name);
                }
                else
-#endif
                {
                        DBG1(DBG_CFG, "failed to open config file '%s'", name);
                }