-
Notifications
You must be signed in to change notification settings - Fork 712
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
Install replaces opensc.conf with a minimal opensc.conf #1102 #1449
Comments
What platform install you refer to? For example on Fedora/RHEL with RPMs, this is not going to happen. If you update opensc with not modified .conf file, you will get a new one, but if you modified this configuration before, the new file will have suffix |
I am referring to make install which used to install a new opensc.conf as opensc.conf.new if opensc.conf existed. Luckily most distributions do a much better job of handling configuration files. |
Using OpenSC master which does not have c003f3825e5217cd3ef8272f4e8ebe47270a7847A I ran some quick Valgrind tests. This was using Aa full opensc.conf with comments has 47880 bytes. Running Valgrind shows with scconf_free cleaning up: By modifying Using opensc.conf.no.comments: Thus by just running With a minimal opensc.conf, (151 bytes in my case, I eliminated all the card_atr and SM entries and comments) Valgrind shows: Modifying the scconf routines to not save comment would save 44K. Then Making all the card_atr and SM stazas comments would get down to the equivalent of the minimal opensc.conf in c003f3825e5217cd3ef8272f4e8ebe47270a7847A and use less the 1000 bytes. So I propose the example opensc.conf also comment out the card_atr and SM stanzas, and add If a user that has memory concerns they can create their own minimal opensc.conf The overwriting of the opensc.conf when using make install still need to be fixed. |
👍 @dengert please make a pull request which avoids overwriting The default behavior should be good enough to not require any configuration file. I only left what's required for making a bug report. If something is missing, we should hard code it (Are you missing something?). |
As requested, Submitted PR #1453. |
@mouse07410 While looking at the scconf_parse, I remember you wanted to use the OpenPGP driver from Tokend, but a PIV driver from PKCS#11. (or was it the reverse?) The way I read the opensc.conf, you could add/modify the block:
This would then cause tokend to use the openpgp driver for the Yubikey 4, but all the other apps Note there is a ` |
Problem Description
Install in previous versions would install
opensc.conf.new
. Now with c003f38 it installs a minimalopensc.conf
overwriting the existingopensc.conf
with any changes the user may have made. (I spent all afternoon trying to figure out what happened.)See #1102
Proposed Resolution
At a minimum, fix the code in c003f38 that tested for an existing opensc.conf in
etc/Makefile.am
and install the minimalopensc.conf
as opensc.conf.newLook at the removed test in: https://github.com/OpenSC/OpenSC/commit/c003f3825e5217cd3ef8272f4e8ebe47270a7847#diff-3392c95f52e00a39c33e6f4ce45b54a3L35
if [ -f "$(DESTDIR)$(sysconfdir)/opensc.conf" ]; then `Another solution is to revert c003f38 and provide a script to remove all the comments and empty stanza formatting to produce a minimal
opensc.conf
from a user edited version of a fullopensc.conf
oropensc.conf.example
with user changes.This may also require many of the lines in
opensc.conf.example
that are not comments such ascard_atr
orsecure_messaging
stanzas. Users of these cards can uncomment them as needed.Then an additional way to address #1102 is to change
scconf_parse
to not allocate memory for stanzas that contain only comments.Steps to reproduce
Logs
The text was updated successfully, but these errors were encountered: