check success of library_init()
authorAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 14 Aug 2009 20:13:51 +0000 (22:13 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Fri, 14 Aug 2009 20:13:51 +0000 (22:13 +0200)
src/charon/plugins/sql/pool.c
src/openac/openac.c
src/scepclient/scepclient.c

index 7d393b6..d45c579 100644 (file)
@@ -637,8 +637,13 @@ int main(int argc, char *argv[])
        } operation = OP_USAGE;
 
        dbg = dbg_stderr;
-       library_init(STRONGSWAN_CONF);
        atexit(library_deinit);
+
+       /* initialize library */
+       if (!library_init(STRONGSWAN_CONF))
+       {
+               exit(SS_RC_LIBSTRONGSWAN_INTEGRITY);
+       }
        lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR,
                lib->settings->get_str(lib->settings, "pool.load", PLUGINS));
        
index b7d303d..408da7f 100755 (executable)
@@ -282,7 +282,11 @@ int main(int argc, char **argv)
        openlog("openac", 0, LOG_AUTHPRIV);
 
        /* initialize library */
-       library_init(STRONGSWAN_CONF);
+       if (!library_init(STRONGSWAN_CONF))
+       {
+               library_deinit();
+               exit(SS_RC_LIBSTRONGSWAN_INTEGRITY);
+       }
        lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, 
                lib->settings->get_str(lib->settings, "openac.load", PLUGINS));
 
index 1139cc2..88dd285 100644 (file)
@@ -386,8 +386,14 @@ int main(int argc, char **argv)
        scep_response     = chunk_empty;
        log_to_stderr     = TRUE;
 
-       /* initialize library and optionsfrom */
-       library_init(STRONGSWAN_CONF);
+       /* initialize library */
+       if (!library_init(STRONGSWAN_CONF))
+       {
+               library_deinit();
+               exit(SS_RC_LIBSTRONGSWAN_INTEGRITY);
+       }
+
+       /* initialize optionsfrom */
        options = options_create();
 
        for (;;)