From: Stef Walter Date: Thu, 7 Aug 2014 06:37:50 +0000 (+0200) Subject: p11-kit: Tweak last commit, handle the not-forked case X-Git-Tag: 0.21.1~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=08a017dbae88f6e57eee387b5984d0494e62d976;p=p11-kit p11-kit: Tweak last commit, handle the not-forked case When we hadn't forked, but were just not initialized, still return CKR_CRYPTOKI_NOT_INITIALIZED from managed modules. --- diff --git a/p11-kit/modules.c b/p11-kit/modules.c index 293ea4d..9eaff40 100644 --- a/p11-kit/modules.c +++ b/p11-kit/modules.c @@ -1590,7 +1590,10 @@ managed_C_Finalize (CK_X_FUNCTION_LIST *self, p11_lock (); pid = getpid (); - if (managed->initialized != pid) { + if (managed->initialized == 0) { + rv = CKR_CRYPTOKI_NOT_INITIALIZED; + + } else if (managed->initialized != pid) { /* * In theory we should be returning CKR_CRYPTOKI_NOT_INITIALIZED here * but enough callers are not completely aware of their forking.