diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2009-07-17 17:00:17 +0200 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2009-07-17 17:00:17 +0200 |
commit | 6b04ba288d6a618d249a9bb3399a65b3297d9f5f (patch) | |
tree | 13c26e10c6f0a05d08c49880e33874f9440c1115 /src/libstrongswan/plugins/plugin_loader.c | |
parent | ca366aeea0b47b7ea1fcdf83dd05ad4e03d39c16 (diff) | |
download | strongswan-6b04ba288d6a618d249a9bb3399a65b3297d9f5f.tar.bz2 strongswan-6b04ba288d6a618d249a9bb3399a65b3297d9f5f.tar.xz |
streamlined debug output of integrity tests
Diffstat (limited to 'src/libstrongswan/plugins/plugin_loader.c')
-rw-r--r-- | src/libstrongswan/plugins/plugin_loader.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/src/libstrongswan/plugins/plugin_loader.c b/src/libstrongswan/plugins/plugin_loader.c index 47c244be3..b402090df 100644 --- a/src/libstrongswan/plugins/plugin_loader.c +++ b/src/libstrongswan/plugins/plugin_loader.c @@ -62,40 +62,48 @@ static plugin_t* load_plugin(private_plugin_loader_t *this, snprintf(file, sizeof(file), "%s/libstrongswan-%s.so", path, name); - if (lib->integrity && - !lib->integrity->check_file(lib->integrity, name, file)) + if (lib->integrity) { - DBG1("file integrity test of plugin '%s' failed", name); - return NULL; + if (!lib->integrity->check_file(lib->integrity, name, file)) + { + DBG1("plugin '%s': failed file integrity test of" + " 'libstrongswan-%s.so'", name, name); + return NULL; + } + DBG1("plugin '%s': passed file integrity test of" + " 'libstrongswan-%s.so'", name, name); } handle = dlopen(file, RTLD_LAZY); if (handle == NULL) { - DBG1("loading plugin '%s' failed: %s", name, dlerror()); + DBG1("plugin '%s': failed to load '%s' - %s", name, file, dlerror()); return NULL; } constructor = dlsym(handle, "plugin_create"); if (constructor == NULL) { - DBG1("loading plugin '%s' failed: no plugin_create() function", name); + DBG1("plugin '%s': failed to load - no plugin_create() function", name); dlclose(handle); return NULL; } - if (lib->integrity && - !lib->integrity->check_segment(lib->integrity, name, constructor)) + if (lib->integrity) { - DBG1("segment integrity test of plugin '%s' failed", name); - dlclose(handle); - return NULL; + if (!lib->integrity->check_segment(lib->integrity, name, constructor)) + { + DBG1("plugin '%s': failed segment integrity test", name); + dlclose(handle); + return NULL; + } + DBG1("plugin '%s': passed segment integrity test", name); } plugin = constructor(); if (plugin == NULL) { - DBG1("loading plugin '%s' failed: plugin_create() returned NULL", name); + DBG1("plugin '%s': failed to load - plugin_create() returned NULL", name); dlclose(handle); return NULL; } - DBG2("plugin '%s' loaded successfully", name); + DBG2("plugin '%s': loaded successfully", name); /* we do not store or free dlopen() handles, leak_detective requires * the modules to keep loaded until leak report */ |