diff options
author | Martin Willi <martin@strongswan.org> | 2009-09-01 16:20:45 +0200 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-09-01 16:20:45 +0200 |
commit | 8fb4edc4ff59fca5dba590f567ffa559bf28522e (patch) | |
tree | 8e48124a54c18e60231bffc092ab6cdb99670fe5 /src/openac/openac.c | |
parent | d6a45127dcce4263bd89710e4d065ee718177490 (diff) | |
download | strongswan-8fb4edc4ff59fca5dba590f567ffa559bf28522e.tar.bz2 strongswan-8fb4edc4ff59fca5dba590f567ffa559bf28522e.tar.xz |
handle plugin loading failures
Diffstat (limited to 'src/openac/openac.c')
-rwxr-xr-x | src/openac/openac.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/openac/openac.c b/src/openac/openac.c index db9959803..d6e75efc3 100755 --- a/src/openac/openac.c +++ b/src/openac/openac.c @@ -220,20 +220,22 @@ int main(int argc, char **argv) openlog("openac", 0, LOG_AUTHPRIV); /* initialize library */ + atexit(library_deinit); if (!library_init(STRONGSWAN_CONF)) { - library_deinit(); exit(SS_RC_LIBSTRONGSWAN_INTEGRITY); } if (lib->integrity && !lib->integrity->check_file(lib->integrity, "openac", argv[0])) { fprintf(stderr, "integrity check of openac failed\n"); - library_deinit(); exit(SS_RC_DAEMON_INTEGRITY); } - lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, - lib->settings->get_str(lib->settings, "openac.load", PLUGINS)); + if (!lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, + lib->settings->get_str(lib->settings, "openac.load", PLUGINS))) + { + exit(SS_RC_INITIALIZATION_FAILED); + } /* initialize optionsfrom */ options_t *options = options_create(); |