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

Restore full support for krb5 traces in debugging #52

Merged
merged 2 commits into from
May 27, 2022

Conversation

simo5
Copy link
Contributor

@simo5 simo5 commented May 27, 2022

In some case /dev/stderr does not point to a path that can be opened with open()
This is the case for example where stderr is redirect to a pipe/socket/fifo.
Systemd init does this in order to capture the standard error in the logs for example.

To deal with this case we crate our own redirecting fifo.

Fixes #44

simo5 added 2 commits May 26, 2022 17:31
Signed-off-by: Simo Sorce <simo@redhat.com>
The proccess stderr may be redirected to a socket or a pipe by the
parent process (which is what systemd does for example).

When that happen we can't simply pass a valid path to stderr so
that libkrb5 can send the tracing via the KRB5_TRACE environment
variable to a our stderr, passing /dev/stderr in this case will
just result in an open error and tracing output going nowhere.

To handle this we create our own fifo to pass to libkrb5 and
then we create a thread that reads the incoming data and pipes
it back to the stderr we've been given by our parent.

Signed-off-by: Simo Sorce <simo@redhat.com>
@simo5 simo5 merged commit 88bfaa1 into gssapi:main May 27, 2022
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 this pull request may close these issues.

krb5 traces missing from journald logs at debug level 3
1 participant