Skip to content

Commit 8de2672

Browse files
committed
Fix Windows split sshd-session state flow
Keep banner exchange in sshd-auth for the split 10.3 flow and restore the post-auth monitor message ordering expected by the sshd-session -z child. Also update the V_10_3_P1 conflict resolution notes with the successful elevated entra-id-debug-localhost validation result.
1 parent d6ce452 commit 8de2672

2 files changed

Lines changed: 7 additions & 21 deletions

File tree

MERGE_V10_3_P1_CONFLICT_RESOLUTION.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ Files:
8888
- contrib/win32/openssh/libssh.vcxproj
8989
- contrib/win32/openssh/unittest-*.vcxproj (multiple)
9090
- servconf.h
91+
- sshd-session.c
9192

9293
Resolution:
9394
- Fixed Windows compile-scope issue in scp command execution path.
9495
- Ensured glob_t declarations are visible where required.
9596
- Synced project file source lists with current upstream/fork code split.
9697
- Applied type alignment in servconf struct field.
98+
- Corrected the Windows split-session privsep state flow so the post-auth `sshd-session -z` child reads the saved identification-exchange state before the authenticated user context.
9799

98100
## Validation Results
99101

@@ -110,8 +112,10 @@ Resolution:
110112

111113
### Functionality test
112114

113-
- Automated functionality test could not run in this environment due missing Administrator privileges.
114-
- Tool reported: Administrator privileges required for service install/user management.
115+
- Validation scenario used: `entra-id-debug-localhost`.
116+
- Ran `sshd.exe -ddd` elevated and validated with the rebuilt `ssh.exe` against `localhost`.
117+
- Result after the follow-up `sshd-session.c` fix: public-key authentication succeeded, `whoami` executed successfully, and the session exited with status 0.
118+
- Observed command output: `NORTHAMERICA+tessgauthier`.
115119

116120
## Notes for Review
117121

sshd-session.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ privsep_preauth(struct ssh *ssh)
650650
#ifdef FORK_NOT_SUPPORTED
651651
if (privsep_auth_child) {
652652
Authctxt *authctxt = ssh->authctxt;
653+
recv_idexch_state(ssh, PRIVSEP_MONITOR_FD);
653654
recv_autxctx_state(authctxt, PRIVSEP_MONITOR_FD);
654655
authctxt->pw = getpwnamallow(ssh, authctxt->user);
655656
authctxt->valid = 1;
@@ -1691,13 +1692,6 @@ main(int ac, char **av)
16911692

16921693
rdomain = ssh_packet_rdomain_in(ssh);
16931694

1694-
#ifdef WINDOWS
1695-
if (privsep_auth_child) {
1696-
recv_idexch_state(ssh, PRIVSEP_MONITOR_FD);
1697-
goto idexch_done;
1698-
}
1699-
#endif /* WINDOWS */
1700-
17011695
/* Log the connection. */
17021696
laddr = get_local_ipaddr(sock_in);
17031697
verbose("Connection from %s port %d on %s port %d%s%s%s",
@@ -1731,18 +1725,6 @@ main(int ac, char **av)
17311725
fatal("login grace time setitimer failed");
17321726
}
17331727

1734-
if ((r = kex_exchange_identification(ssh, -1,
1735-
options.version_addendum)) != 0)
1736-
#ifdef WINDOWS
1737-
{
1738-
send_kex_exch_exit_code_telemetry(r);
1739-
#endif /* WINDOWS */
1740-
sshpkt_fatal(ssh, r, "banner exchange");
1741-
#ifdef WINDOWS
1742-
}
1743-
send_kex_exch_exit_code_telemetry(0);
1744-
#endif /* WINDOWS */
1745-
idexch_done:
17461728
ssh_packet_set_nonblocking(ssh);
17471729

17481730
/* allocate authentication context */

0 commit comments

Comments
 (0)