Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading references to /etc/reader.conf throughout the documentation #115

Closed
kirelagin opened this issue Dec 4, 2021 · 7 comments
Closed

Comments

@kirelagin
Copy link
Contributor

If I am reading the code correctly, there are two potential sources of configuration:

  1. The file (or, actually, directory) optionally given as -c to the daemon.
  2. The directory (or, actually, file) specified at build time as --enable-confdir and known in the code as PCSCLITE_CONFIG_DIR.

The former defaults to nothing and takes precedence over the latter; the latter defaults to ${sysconfdir}/reader.conf.d.

At the same time, the documentation (and code comments) extensively mention /etc/reader.conf as the configuration file. Which, like, if I am not misreading the code, has no special significance and is never used, unless explicitly given as -c or --enable-confdir was somewhat weirdly and contrary to its intended use as a directory set to /etc/reader.conf?

I guess, that’s first of all a clarification request: do I understand the actual logic of the code correctly? If yes, then, I guess, it would be great to update the documentation.

LudovicRousseau added a commit that referenced this issue Dec 4, 2021
Thanks to Kirill Elagin
" Misleading references to /etc/reader.conf throughout the documentation #115 "
#115
LudovicRousseau added a commit that referenced this issue Dec 4, 2021
Thanks to Kirill Elagin
" Misleading references to /etc/reader.conf throughout the documentation #115 "
#115
@LudovicRousseau
Copy link
Owner

You are right. It is confusing.
Historically only the file /etc/reader.conf was used. But it was difficult to use with 2 or more readers. So I moved to a directory. But the documentation was not updated.

I fixed the documentation. Please review.

@kirelagin
Copy link
Contributor Author

kirelagin commented Dec 4, 2021

Thanks for addressing this!

There are still a bunch of references remaining in documentation and user-facing messages:

  • AS_HELP_STRING([--disable-serial],[do not use serial reader.conf file]),
    (maybe something like “reader.conf.d files”?)
  • .IR @PCSCLITE_CONFIG_DIR@/reader.conf .
    and some other locations in the same file (in other places you replaced it with my_reader.conf)
  • Log2(PCSC_LOG_ERROR, "WARNING: USB drivers SHOULD NOT be declared in reader.conf: %s", pcLibpath);
  • I would also suggest renaming the man file from reader.conf to reader.conf.d, which seems to be a fairly standard thing to do for this kind of direcotry-based configuration (e.g. man tmpfiles.d).

LudovicRousseau added a commit that referenced this issue Dec 4, 2021
Thanks to Kirill Elagin
" Misleading references to /etc/reader.conf throughout the documentation #115 "
#115
LudovicRousseau added a commit that referenced this issue Dec 4, 2021
Thanks to Kirill Elagin
" Misleading references to /etc/reader.conf throughout the documentation #115 "
#115
LudovicRousseau added a commit that referenced this issue Dec 4, 2021
Thanks to Kirill Elagin
" Misleading references to /etc/reader.conf throughout the documentation #115 "
#115
@LudovicRousseau
Copy link
Owner

Better now?
I do not plan to rename the reader.conf.5 manpage. Non-USB readers are very rare now. I don't know if reader.conf files are really used.

@kirelagin
Copy link
Contributor Author

Yes, I think now you have addressed all the remaining occurrences. Thanks again for handling this!

@kirelagin
Copy link
Contributor Author

kirelagin commented Dec 5, 2021

Ah, one last thing. You updated the man page for pcscd to say that -c takes a directory instead of a file, however the code still refers to it as a file:

  • printf(" -c, --config path to reader.conf\n");
  • Log2(PCSC_LOG_INFO, "using new config file: %s", optarg);
  • Log3(PCSC_LOG_CRITICAL, "invalid file %s: %s", newReaderConfig,
    (this one is especially unclear, since, hmm, I’m not sure when the function fails – will it fail if only one of the files in the directory is wrong? how does the user know what exactly in the entire directory caused the problem?)

@kirelagin kirelagin reopened this Dec 5, 2021
LudovicRousseau added a commit that referenced this issue Dec 5, 2021
Thanks to Kirill Elagin
" Misleading references to /etc/reader.conf throughout the documentation #115 "
#115
@LudovicRousseau
Copy link
Owner

I made some modifications in pcscdaemon.c and also improved pcscd.8 manpage.

@kirelagin
Copy link
Contributor Author

I think it’s perfect now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants