Repository navigation
add back explicit termination of preauth child process - #814
Tess Gauthier (tgauth) merged 1 commit into
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the grace alarm handler behavior on Windows to ensure both session processes exit when LoginGraceTime expires, and includes a minor formatting correction.
- Added Windows-specific logic to explicitly kill the child process when the login grace period expires
- Updated test expectations to verify both session processes exit after grace timeout
- Removed trailing whitespace from a comment
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sshd-session.c | Added Windows-specific grace alarm handler to kill child process via pmonitor PID; removed trailing whitespace from comment |
| regress/pesterTests/SSHD.Tests.ps1 | Updated test assertion to expect both session processes to exit after LoginGraceTime expires |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
I was thinking of making the following changes to kill all child processes (we have a list of their pids in Add to the ...
else if (signum == SIGALRM) {
if (handler == grace_alarm_handler) {
set_atexit([]{
for (auto child : children) {
TerminateProcess(child.pid, 0);
CloseHandle(child.handle);
}
});
}
else if (handler == SIG_DFL) {
/* reset atexit */
}
} |
|
Here's a working fix that terminates all child processes: latestw_all...o-sdn-o:openssh-portable:Fix-child-processes-termination-at-exit |
|
I have a question - is it legal to state the following (from my fix 72114b9): static void
grace_alarm_handler(int sig)
{
#ifdef WINDOWS
/* We don't have to be signal-safe on Windows. Different native event mechanisms (APC). */
exit(EXIT_LOGIN_GRACE); /* Perform full C library cleanup and call atexit() registered functions. */
#else
...
_exit(EXIT_LOGIN_GRACE); /* We have to be signal-safe. */
#endif
} |
In the current codebase, openssh-portable/contrib/win32/win32compat/signal_sigchld.c Lines 130 to 136 in 18133aa openssh-portable/contrib/win32/win32compat/signal.c Lines 196 to 198 in 18133aa |
AI Overview
|
| send_config_state(int fd, struct sshbuf* conf) | ||
| { | ||
| /* copied from send_rexec_state() in sshd.c | ||
| /* copied from send_rexec_state() in sshd.c |
There was a problem hiding this comment.
Is this trailing space from upstream? I would leave it unchanged if that is the case just to reduce discrepancies
Perhaps I haven't expressed myself clearly enough here. At first glance, it seems the answer is No. Here's the question and the detailed answer: I asked:
Answer:
PS: |
PR Summary
PR Context