Bug 55051 - Don't fail initialization if last initialized module fails
Summary: Don't fail initialization if last initialized module fails
Status: RESOLVED FIXED
Alias: None
Product: p11-glue
Classification: Unclassified
Component: p11-kit (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Stef Walter
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-18 14:36 UTC by Stef Walter
Modified: 2013-02-12 15:19 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Don't fail initialization if last initialized module fails (1.42 KB, patch)
2012-09-18 14:36 UTC, Stef Walter
Details | Splinter Review

Description Stef Walter 2012-09-18 14:36:32 UTC
In the case where the last non-critical module initialization failed
the entire initialization of all registered p11-kit modules would
fail. This was because the result rv code was not being reset corretly.

This was not taken into account for this patch:

http://cgit.freedesktop.org/p11-glue/p11-kit/commit/?id=483db3ee5d0c0e92dd8ecd8bf0cbefaa6254b6eb
Comment 1 Stef Walter 2012-09-18 14:36:34 UTC
Created attachment 67328 [details] [review]
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.
Comment 2 Stef Walter 2012-09-18 14:43:50 UTC
To try this out, Set 'user-config: only' in ~/.pkcs11/pkcs11.conf

Then make sure that only a filed called 'nss.module' exists in ~/.pkcs11/modules/, with (invalid) contents like this:

module: /usr/lib64/libsoftokn3.so
x-init-reserved: configdir='sql:/blah/.pki/nssdb' certPrefix='' keyPrefix='' secmod='secmod.db' flags=optimizeSpace updatedir='' updateCertPrefix='' updateKeyPrefix='' updateid='' updateTokenDescription='' 

Before the patch 'p11-kit -l' would return a non-zero exit code. After it'll return success.
Comment 3 Stef Walter 2013-02-12 15:03:06 UTC
This was pushed into git master before the 0.15.1 release.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.