Repository navigation
Conversation
alvarosth
force-pushed
the
pam-fork-failure
branch
from
October 18, 2026 15:57
d78d7ac to
2a6409c
Compare
outfoxxed
force-pushed
the
master
branch
2 times, most recently
from
October 22, 2026 06:48
bf6302e to
9b0f339
Compare
alvarosth
force-pushed
the
pam-fork-failure
branch
from
October 28, 2026 14:30
2a6409c to
9c17c5b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Fixes #1275.
On fork failure, close the four pipe fds, free the three strings and return
0, sostart()reportsInternalErrorthrough its existing failure path.Cleanup handlers now require
childPid > 0before callingkill()orwaitpid().Details and decisions
Returning
0matches the existingpipe()failure path. The positive-PID guard adds defence in depth against passing-1tokill()orwaitpid().This fix does not depend on #1256.
Testing with an
LD_PRELOADshim forcing fork failure, with stdin as/dev/nulland as an open pipe, showed nokill(-1),waitpid(-1)or leaked pipe fds. Normal authentication is unaffected. clang-format and clang-tidy (tidyfox) are clean.Open concerns
#1256 adds a third pipe. Whichever PR merges second will need to close that pipe on fork failure too.
The existing leak when the second
pipe()fails is left out to keep this fix minimal.