Skip to content

Allow terminal and SFTP/SCP in embedded client-only builds - #1215

Open
peteclarke-del wants to merge 1 commit into
wolfSSL:masterfrom
peteclarke-del:portability-embedded-client
Open

Allow terminal and SFTP/SCP in embedded client-only builds#1215
peteclarke-del wants to merge 1 commit into
wolfSSL:masterfrom
peteclarke-del:portability-embedded-client

Conversation

@peteclarke-del

Copy link
Copy Markdown

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_TERM is gated on !NO_FILESYSTEM in three places, in src/ssh.c and
src/internal.c. 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 to say why.

The SFTP and SCP client entry point in wolfSSH_stream_read is gated on
!NO_WOLFSSH_SERVER, so a client-only build cannot use SFTP or SCP even though
the guarded code is the client half.

This drops the two guards. A build that defines neither NO_FILESYSTEM nor
NO_WOLFSSH_SERVER is 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_TERM is silently inert and SFTP is
unavailable.

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.

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.
@wolfSSL-Bot

Copy link
Copy Markdown

Can one of the admins verify this patch?

@dgarske

dgarske commented Aug 31, 2026

Copy link
Copy Markdown
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.
Thanks, David Garske, wolfSSL

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

Successfully merging this pull request may close these issues.

4 participants