Allow terminal and SFTP/SCP in embedded client-only builds - #1215
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? |
|
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. |
|
@peteclarke-del Your project sounds pretty cool. I've only just heard of the Acorn; I'm a Commodore 64 guy. I can only accept your change if you fill out a contributor agreement first. If I don't hear back from you in a few days, I'm going to recreate the change as a bug-fix based on your description text. --John |
|
I am going to close this PR. I'll have another one up treating this as a bugfix/changereq. |
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.