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

Remove debug_file= #357

Merged
merged 6 commits into from
Mar 3, 2025
Merged

Remove debug_file= #357

merged 6 commits into from
Mar 3, 2025

Conversation

dacav
Copy link
Contributor

@dacav dacav commented Mar 3, 2025

We are removing the debug_file= option, both from the pam_u2f.so arguments and configuration.

The module loses the ability to send debug info towards a file or stdout. It is still possible to log on stderr via syslog, e.g.

openlog(argv[0], LOG_PERROR, 0);

This is a breaking change, so it is targeting the next branch instead of main, meaning that these change will flow into the first scheduled major bump.

dacav added 6 commits March 3, 2025 09:19
pam-u2f.so loses the ability to send debug info towards a file or stdout.
It is still possible to log on stderr via syslog, e.g.:

  openlog(argv[0], LOG_PERROR, 0);

Changelog: breaking
cfg_t::debug_file is no longer assigned in tests.  Nothing else is referencing
the field, so now we can remove it too.

This commit introduces a mock syslog implementation that hijacks the
logging on stderr.  The intention is to avoid spamming the system
log when the unit tests are compiled with Automake.

The approach seems to be effective on all tested systems, but it is not clear
if relies on a well defined behaviour, that will work on *all* systems.  We
accept the risk for now, since this is only affecting the tests, only for
Automake, and since the most likely adverse outcome is syslog spamming.

The CMake build, which will eventually replace Automake, is not affected:
in such context the unit tests are linked against a dedicated build of the
tested code, compiled with the PAM_U2F_TESTING macro defined.
@dacav dacav requested a review from LDVG March 3, 2025 08:36
@dacav dacav merged commit 9c58982 into next Mar 3, 2025
31 checks passed
@dacav dacav deleted the dacav/syslog_1 branch March 3, 2025 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants