From 8ed6aff82893f4e493ea083e97e1418e17271a62b9f3ec29c041fbb191802c01 Mon Sep 17 00:00:00 2001 From: Otto Hollmann Date: Thu, 9 May 2024 13:59:05 +0000 Subject: [PATCH] Accepting request 1172950 from home:dbenini:branches:security:chipcard - Fix for bsc#1221255: * Add patch 0001-Set-slot_num-configuration-parameter-to-0-by-default.patch OBS-URL: https://build.opensuse.org/request/show/1172950 OBS-URL: https://build.opensuse.org/package/show/security:chipcard/pam_pkcs11?expand=0&rev=37 --- ...figuration-parameter-to-0-by-default.patch | 39 +++++++++++++++++++ pam_pkcs11.changes | 6 +++ pam_pkcs11.spec | 1 + 3 files changed, 46 insertions(+) create mode 100644 0001-Set-slot_num-configuration-parameter-to-0-by-default.patch diff --git a/0001-Set-slot_num-configuration-parameter-to-0-by-default.patch b/0001-Set-slot_num-configuration-parameter-to-0-by-default.patch new file mode 100644 index 0000000..21a9a43 --- /dev/null +++ b/0001-Set-slot_num-configuration-parameter-to-0-by-default.patch @@ -0,0 +1,39 @@ +From 8da6c472ddcf18a30676bf8f7c55785dd2de91c5 Mon Sep 17 00:00:00 2001 +From: Paul Wolneykien +Date: Fri, 26 Apr 2024 18:10:24 +0300 +Subject: [PATCH] Set 'slot_num' configuration parameter to 0 by default + +See https://github.com/OpenSC/pam_pkcs11/pull/74 for details. + +Signed-off-by: Paul Wolneykien +--- + src/pam_pkcs11/pam_config.c | 11 +++-------- + 1 file changed, 3 insertions(+), 8 deletions(-) + +--- a/src/pam_pkcs11/pam_config.c ++++ b/src/pam_pkcs11/pam_config.c +@@ -50,7 +50,7 @@ struct configuration_st configuration = + NULL, /* const char *pkcs11_module_path; */ + NULL, /* screen savers */ + NULL, /* slot_description */ +- -1, /* int slot_num; */ ++ 0, /* int slot_num; */ + 0, /* support threads */ + /* cert policy; */ + { +@@ -167,13 +167,8 @@ static void parse_config_file(void) { + configuration.slot_num = + scconf_get_int(pkcs11_mblk,"slot_num",configuration.slot_num); + +- if (configuration.slot_description != NULL && configuration.slot_num != -1) { +- DBG1("Can not specify both slot_description and slot_num in file %s",configuration.config_file); +- return; +- } +- +- if (configuration.slot_description == NULL && configuration.slot_num == -1) { +- DBG1("Neither slot_description nor slot_num found in file %s",configuration.config_file); ++ if (configuration.slot_description != NULL && configuration.slot_num != 0) { ++ DBG1("Can not specify both slot_description and slot_num != 0 in file %s",configuration.config_file); + return; + } + diff --git a/pam_pkcs11.changes b/pam_pkcs11.changes index 8620171..7f38153 100644 --- a/pam_pkcs11.changes +++ b/pam_pkcs11.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue May 7 15:19:11 UTC 2024 - Davide Benini + +- Fix for bsc#1221255: + * Add patch 0001-Set-slot_num-configuration-parameter-to-0-by-default.patch + ------------------------------------------------------------------- Thu Feb 29 14:54:54 UTC 2024 - Dominique Leuenberger diff --git a/pam_pkcs11.spec b/pam_pkcs11.spec index fd92ec6..4e36911 100644 --- a/pam_pkcs11.spec +++ b/pam_pkcs11.spec @@ -34,6 +34,7 @@ Source4: pkcs11_eventmgr.service Patch0: %{name}-fsf-address.patch Patch1: %{name}-0.5.3-nss-conf.patch Patch3: %{name}-0.6.0-nss-autoconf.patch +Patch4: 0001-Set-slot_num-configuration-parameter-to-0-by-default.patch BuildRequires: curl-devel BuildRequires: docbook-xsl-stylesheets BuildRequires: doxygen