ipa-advise: if p11-kit provides opensc, don't add to NSS db

p11-kit-proxy in newer distributions handles loading the OpenSC
PKCS#11 library so don't try to add it to the NSS database in
/etc/pki/nssdb if it is already available in order to avoid a
potentially confusing error message.

https://pagure.io/freeipa/issue/8934

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
Rob Crittenden authored and Florence Blanc-Renaud committed 2021-08-04 08:42:18 +02:00
1 parent 25a4acf3ad
commit 018ee09ccb
1 file changed
+3 -2
+3 -2
View File
@@ -306,8 +306,9 @@ class config_client_for_smart_card_auth(common_smart_card_auth_config):
shared_lib = self.pkcs11_shared_lib
self.log.commands_on_predicate(
'modutil -dbdir {} -list | grep -q {}'.format(
nssdb, module_name),
'modutil -dbdir {nssdb} -list | grep -q {module_name} || '
'p11-kit list-modules | grep -i {module_name} -q'.format(
nssdb=nssdb, module_name=module_name),
[
'echo "{} PKCS#11 module already configured"'.format(
module_name)