Skip to content

fix: acknowledge remote SFTP channel closes - #1528

Open
edsonsims wants to merge 1 commit into
mscdex:masterfrom
edsonsims:fix/acknowledge-sftp-channel-close
Open

edsonsims wants to merge 1 commit into
mscdex:masterfrom
edsonsims:fix/acknowledge-sftp-channel-close

Conversation

@edsonsims

Copy link
Copy Markdown

When a peer closes an SFTP channel, the local side emits close without sending the reciprocal CHANNEL_CLOSE. The peer therefore retains a half-closed channel while the SSH connection stays open (#1522).

I route SFTP channels through the existing destroy() method in the shared close handler, preserving its state and connection-death guards. Regression tests cover both initiators, duplicate close packets, a subsequent command on the same connection, and already-closing/closed/dead controls.

Validation: the complete suite (15 test scripts) and lint pass with Node 24.22.1/OpenSSH 9.2 in an isolated Linux arm64 container. The new regressions and lint also pass on macOS/Node 24.19. The full macOS suite retains an existing failure because OpenSSH 10.5 rejects the harness's ssh-dss options; the same failure occurs on the original base. The optional crypto addon was not built.

Fixes #1522

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.

Client never replies with CHANNEL_CLOSE when the server closes an SFTP channel (RFC 4254 §5.3)

1 participant