summaryrefslogtreecommitdiff
path: root/p11-kit/modules.c
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2012-09-18 14:01:54 +0200
committerStef Walter <stefw@gnome.org>2012-09-18 16:36:32 +0200
commit3e82c6182d913a3fd5cf904342a9a6fa44aef0d6 (patch)
tree87b7a9fc980b268303be0d9bfbbcf1bf4239d9de /p11-kit/modules.c
parent37889e5f7ca5e2e45442f98dc84efb70d2acf907 (diff)
Don't fail initialization if last initialized module fails
* We weren't resetting the result code after a failure, so even though failures for critical modules didn't interrupt the initialization loop, the result still leaked to callers. * Also print an error message clearly indicating that a module failed to initialize, regardless of whether critical or not. https://bugs.freedesktop.org/show_bug.cgi?id=55051
Diffstat (limited to 'p11-kit/modules.c')
-rw-r--r--p11-kit/modules.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/p11-kit/modules.c b/p11-kit/modules.c
index 547ee02..9dc3a3a 100644
--- a/p11-kit/modules.c
+++ b/p11-kit/modules.c
@@ -733,11 +733,13 @@ _p11_kit_initialize_registered_unlocked_reentrant (void)
* then this, should abort loading of others.
*/
if (rv != CKR_OK) {
+ _p11_message ("failed to initialize module: %s: %s",
+ mod->name, p11_kit_strerror (rv));
+
critical = _p11_conf_parse_boolean (_p11_hash_get (mod->config, "critical"), 0);
- if (critical) {
- _p11_debug ("failed to initialize module: %s: %s",
- mod->name, p11_kit_strerror (rv));
- break;
+ if (!critical) {
+ _p11_debug ("ignoring failure, non-critical module: %s", mod->name);
+ rv = CKR_OK;
}
}
}