From f18eb2baa7628d6ddf23c8a8b92bf33afcd84f28 Mon Sep 17 00:00:00 2001 From: Pete Clarke Date: Mon, 31 Aug 2026 01:52:24 +0100 Subject: [PATCH] Allow terminal and SFTP/SCP in embedded client-only builds 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. --- src/internal.c | 2 +- src/ssh.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/internal.c b/src/internal.c index 4a42ac9e9..c930718bb 100644 --- a/src/internal.c +++ b/src/internal.c @@ -20864,7 +20864,7 @@ int SendChannelRequest(WOLFSSH* ssh, byte* name, word32 nameSz) } -#if defined(WOLFSSH_TERM) && !defined(NO_FILESYSTEM) +#if defined(WOLFSSH_TERM) /* out is always a TERMINAL_MODES_MAX_SZ buffer, and one byte is held back * for the terminator CreateMode() appends */ diff --git a/src/ssh.c b/src/ssh.c index 32c234b2a..c54d30cbd 100644 --- a/src/ssh.c +++ b/src/ssh.c @@ -1070,7 +1070,7 @@ int wolfSSH_connect(WOLFSSH* ssh) FALL_THROUGH; case CONNECT_CLIENT_CHANNEL_AGENT_REQUEST_SENT: - #if defined(WOLFSSH_TERM) && !defined(NO_FILESYSTEM) + #if defined(WOLFSSH_TERM) if (ssh->sendTerminalRequest) { if ( (ssh->error = SendChannelTerminalRequest(ssh)) < WS_SUCCESS) { @@ -1747,7 +1747,7 @@ void* wolfSSH_GetPublicKeyCheckCtx(WOLFSSH* ssh) } -#if defined(WOLFSSH_TERM) && !defined(NO_FILESYSTEM) +#if defined(WOLFSSH_TERM) /* Used to resize terminal window with shell connections * returns WS_SUCCESS on success */ int wolfSSH_ChangeTerminalSize(WOLFSSH* ssh, word32 columns, word32 rows, @@ -4868,8 +4868,7 @@ void* wolfSSH_GetChannelCloseCtx(WOLFSSH* ssh) } -#if (defined(WOLFSSH_SFTP) || defined(WOLFSSH_SCP)) && \ - !defined(NO_WOLFSSH_SERVER) +#if defined(WOLFSSH_SFTP) || defined(WOLFSSH_SCP) /* * Paths starting with a slash are absolute, rooted at "/". Any path that