-
Notifications
You must be signed in to change notification settings - Fork 99
do not treat shell as interactive until pty-req received #832
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.