Skip to content

Commit

Permalink
Set 'slot_num' configuration parameter to 0 by default
Browse files Browse the repository at this point in the history
See #74 for details.

Signed-off-by: Paul Wolneykien <[email protected]>
  • Loading branch information
wolneykien committed Apr 26, 2024
1 parent 6866efd commit 8da6c47
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/pam_pkcs11/pam_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct configuration_st configuration = {
CONFDIR "/pkcs11_module.so",/* const char *pkcs11_module_path; */
NULL, /* screen savers */
NULL, /* slot_description */
-1, /* int slot_num; */
0, /* int slot_num; */
0, /* support threads */
/* cert policy; */
{
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 8da6c47

Please sign in to comment.