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

SFTP session fails to close #1153

Open
diwic opened this issue Mar 22, 2022 · 1 comment
Open

SFTP session fails to close #1153

diwic opened this issue Mar 22, 2022 · 1 comment

Comments

@diwic
Copy link

diwic commented Mar 22, 2022

I'm trying to upgrade from ssh2 0.8.7 to git master (1.7.0 failed to build due to #1149 or something similar), and I'm having troubles with my sftp server not closing the connection correctly. If I'm using the standard tool sftp -vvv to retreive a file, this is where it stops:

debug3: Sent message SSH2_FXP_CLOSE I:8
debug3: SSH2_FXP_STATUS 0
debug2: channel 0: read<=0 rfd 4 len 0
debug2: channel 0: read failed
debug2: channel 0: close_read
debug2: channel 0: input open -> drain
debug2: channel 0: ibuf empty
debug2: channel 0: send eof
debug3: send packet: type 96
debug2: channel 0: input drain -> closed

After some research, I found RFC 4254 which claims that type 96 is SSH_MSG_CHANNEL_EOF and that Upon receiving this message, a party MUST send back an SSH_MSG_CHANNEL_CLOSE.

It looks to me like the sftp server does not do this correctly (i e, send back a SSH_MSG_CHANNEL_CLOSE), and so the connection stalls.

@mscdex
Copy link
Owner

mscdex commented Mar 22, 2022

That will probably be fixed by #1111 once a working test is created.

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

No branches or pull requests

2 participants