Allow terminal and SFTP/SCP in embedded client-only builds - #1215
Open
peteclarke-del wants to merge 1 commit into
Open
Allow terminal and SFTP/SCP in embedded client-only builds#1215peteclarke-del wants to merge 1 commit into
peteclarke-del wants to merge 1 commit into
Conversation
WOLFSSH_TERM is gated on !NO_FILESYSTEM in three places, but neither the window dimensions nor the terminal mode string is read from disk: both are computed. On a target built with NO_FILESYSTEM, WOLFSSH_TERM therefore compiles away and a client cannot request a PTY or send its terminal modes, with no diagnostic. The SFTP and SCP client entry point in wolfSSH_stream_read is likewise gated on !NO_WOLFSSH_SERVER, so a client-only build cannot use SFTP or SCP even though the guarded code is the client half. Dropping the two guards lets an embedded client-only target use terminal requests and the SFTP client. A build that defines neither NO_FILESYSTEM nor NO_WOLFSSH_SERVER is unaffected.
|
Can one of the admins verify this patch? |
Member
|
Hi @peteclarke-del , thank you for your contribution! Can you tell us more about your project and if you plan to submit any additional PR's? Since this is a small change we might treat as bug report and fix ourselves. See https://github.com/wolfSSL/wolfssh/blob/master/CONTRIBUTING.md for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two compile-time guards exclude code that an embedded, client-only target
needs, and neither guard matches what the code behind it actually does.
WOLFSSH_TERMis gated on!NO_FILESYSTEMin three places, insrc/ssh.candsrc/internal.c. Neither the window dimensions nor the terminal mode string isread from disk; both are computed. On a target built with
NO_FILESYSTEM,WOLFSSH_TERMtherefore compiles away and a client cannot request a PTY or sendits terminal modes, with no diagnostic to say why.
The SFTP and SCP client entry point in
wolfSSH_stream_readis gated on!NO_WOLFSSH_SERVER, so a client-only build cannot use SFTP or SCP even thoughthe guarded code is the client half.
This drops the two guards. A build that defines neither
NO_FILESYSTEMnorNO_WOLFSSH_SERVERis unaffected.Found while running wolfSSH as an SSH and SFTP client on a bare-metal Raspberry
Pi with no filesystem and no server, serving an Acorn 8-bit host over its 1MHz
bus. With these two guards dropped the client negotiates a PTY and SFTP
transfers work; without them
WOLFSSH_TERMis silently inert and SFTP isunavailable.
I have kept our display defaults out of this change deliberately: the 40-column
and vt100 values that suit the Acorn host are a local choice and are not
proposed here. If a configurable default would be welcome I am happy to follow
up with one.