summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2012-06-27 11:15:33 +0200
committerStef Walter <stefw@gnome.org>2012-06-27 11:18:25 +0200
commit483db3ee5d0c0e92dd8ecd8bf0cbefaa6254b6eb (patch)
tree05f7836baf5ed67f4996c889b3762f37b0101617
parent59774b11eb478cc714a6c5da937e89c6089fd833 (diff)
downloadp11-kit-483db3ee5d0c0e92dd8ecd8bf0cbefaa6254b6eb.tar.gz
If a module is not marked 'critical' then ignore failure
* Ignore failure when initializing registered modules when 'critical' is not set on a module.
-rw-r--r--p11-kit/modules.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/p11-kit/modules.c b/p11-kit/modules.c
index 0694895..69fa88f 100644
--- a/p11-kit/modules.c
+++ b/p11-kit/modules.c
@@ -710,6 +710,7 @@ _p11_kit_initialize_registered_unlocked_reentrant (void)
{
Module *mod;
hashiter iter;
+ int critical;
CK_RV rv;
rv = init_globals_unlocked ();
@@ -727,10 +728,17 @@ _p11_kit_initialize_registered_unlocked_reentrant (void)
rv = initialize_module_unlocked_reentrant (mod);
+ /*
+ * Module failed to initialize. If this is a critical module,
+ * then this, should abort loading of others.
+ */
if (rv != CKR_OK) {
- _p11_debug ("failed to initialize module: %s: %s",
- mod->name, p11_kit_strerror (rv));
- break;
+ 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;
+ }
}
}
}