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

Log.c not adding end of line in many cases in debug log #2378

Closed
dengert opened this issue Aug 6, 2021 · 0 comments · Fixed by #2379
Closed

Log.c not adding end of line in many cases in debug log #2378

dengert opened this issue Aug 6, 2021 · 0 comments · Fixed by #2379

Comments

@dengert
Copy link
Member

dengert commented Aug 6, 2021

Problem Description

This should be fixed before release of 0.22.0.

Regression of opensc.debug.log formatting. New line characters are missing in some cases.

Problem appears to be caused by 99656de which dropped log.c lines-147-148 that would add a "\n" if needed.

Logs

For example the first line of debug log now looks like:

P:27245; T:0x139925753395264 07:52:02.170 [opensc-pkcs11] ../../../src/src/libopensc/ctx.c:855:sc_context_create: ===================================P:27245; T:0x139925753395264 07:52:02.170 [opensc-pkcs11] ../../../src/src/libopensc/ctx.c:856:sc_context_create: opensc version: 0.22.0-rc2P:27245; T:0x139925753395264 07:52:02.171 [opensc-pkcs11] ../../../src/src/libopensc/reader-pcsc.c:886:pcsc_init: PC/SC options: connect_exclusive=0 disconnect_action=0 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1P:27245; T:0x139925753395264 07:52:02.171 [opensc-pkcs11] ../../../src/src/libopensc/reader-pcsc.c:1386:pcsc_detect_readers: called

Where in past it would be 3 lines:

P:27245; T:0x139925753395264 07:52:02.170 [opensc-pkcs11] ../../../src/src/libopensc/ctx.c:855:sc_context_create: ===================================
P:27245; T:0x139925753395264 07:52:02.170 [opensc-pkcs11] ../../../src/src/libopensc/ctx.c:856:sc_context_create: opensc version: 0.22.0-rc2P:27245; T:0x139925753395264 07:52:02.171 [opensc-pkcs11] ../../../src/src/libopensc/reader-pcsc.c:886:pcsc_init: PC/SC options: connect_exclusive=0 disconnect_action=0 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1
P:27245; T:0x139925753395264 07:52:02.171 [opensc-pkcs11] ../../../src/src/libopensc/reader-pcsc.c:1386:pcsc_detect_readers: called

Proposed Resolution

Revert 99656de
Or add new logic to add a "\n". But without using a buffer this will be difficult.
It might be possible to test if format ends in "\n".

dengert added a commit to dengert/OpenSC that referenced this issue Aug 6, 2021
 On branch master
 Your branch is up to date with 'upstream/master'.

 Changes to be committed:
	modified:   log.c
dengert added a commit to dengert/OpenSC that referenced this issue Aug 6, 2021
 On branch Fix-new-line
 Changes to be committed:
	modified:   log.c
frankmorgner added a commit that referenced this issue Aug 9, 2021
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

Successfully merging a pull request may close this issue.

1 participant