do not treat shell as interactive until pty-req received#832
do not treat shell as interactive until pty-req received#832ejohnstown merged 3 commits intowolfSSL:masterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes WinSCP connection issues by preventing wolfSSHd from treating shells as interactive until a pty-req is received. Previously, WinSCP would hang after SSH handshake because wolfSSHd was sending interactive terminal characters even when no PTY was requested.
- Added a new
ptyReqflag to track when an interactive PTY request is received - Modified shell subsystem logic to use non-interactive mode by default
- Added API function to check if PTY request was received
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| wolfssh/ssh.h | Added new API function declaration for checking PTY request status |
| wolfssh/internal.h | Added ptyReq flag to WOLFSSH struct to track PTY request state |
| src/ssh.c | Implemented the new API function to return PTY request status |
| src/internal.c | Set the ptyReq flag when processing channel PTY requests |
| apps/wolfsshd/wolfsshd.c | Modified shell subsystem to use non-interactive mode unless PTY is requested |
Comments suppressed due to low confidence (1)
src/ssh.c:266
- Inconsistent indentation: this line uses tabs while the surrounding code uses spaces. Should use consistent spacing throughout the function.
return 0;
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
d918d7b to
4b35371
Compare
4b35371 to
6fe09bd
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Great feedback. I refactored the flag to be at the Channel level and adjust the checks on the flag in wolfsshd.c |
ZD20321
WinSCP fails to connect with "SCP" and "Default" shell used. This is because WinSCP is opening a shell subsystem but not using pty-req and expecting the server to create a non-interactive shell. wolfSSHd previously would send interactive terminal characters which confused WinSCP leading to it hanging after the SSH handshake was completed.