Fix the client-only and server-only builds - #1264
Open
ejohnstown wants to merge 3 commits into
Open
ejohnstown wants to merge 3 commits into
ejohnstown wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical and moderate findings remain in tests/include.am and tests/regress.c.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Fixes client-only and server-only builds by gating role-specific tests and scripts and making wolfSSH_RealPath() available to SFTP/SCP clients.
Changes:
- Adds
BUILD_SERVERandBUILD_CLIENTconditionals. - Gates endpoint-dependent tests and scripts.
- Adjusts client/server test coverage and
wolfSSH_RealPath()compilation.
File summaries
| File | Summary |
|---|---|
tests/unit.c |
Gates server-specific SFTP tests. |
tests/regress.c |
Gates client-session regression cases; a moderate unused-function issue remains. |
tests/include.am |
Gates role-dependent test targets; api.test still needs a client-build gate (critical). |
src/ssh.c |
Builds wolfSSH_RealPath() for SFTP/SCP clients. |
scripts/include.am |
Gates integration scripts by required endpoint. |
configure.ac |
Defines server/client Automake conditionals. |
Review details
Suppressed comments (1)
tests/regress.c:16437
- This gates the only call to
TestTerminalResizeBlockedAfterDisconnect()in aNO_WOLFSSH_CLIENTbuild, but the function definition at lines 11843-11880 is still compiled under onlyWOLFSSH_TERM && !NO_FILESYSTEM. That leaves a static function unused (and the project builds with-Wallin its compiler matrix), so the one-sided build can fail on-Wunused-function; put the same client guard around the definition or mark itWS_MAYBE_UNUSED.
#if defined(WOLFSSH_TERM) && !defined(NO_FILESYSTEM) \
&& !defined(NO_WOLFSSH_CLIENT)
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
A --disable-server build now links, and make check builds and runs what does not need a server. wolfSSH_RealPath() is compiled whenever SFTP or SCP is enabled, because the SFTP client reaches it through wolfSSH_SFTP_SetDefaultPath(), and the test programs that link examples/echoserver are built only when the server half is. - Drop the server term from the wolfSSH_RealPath() guard in ssh.c; the block holds that one function. - Add BUILD_SERVER and BUILD_CLIENT conditionals off the existing ENABLED_SERVER and ENABLED_CLIENT. - Gate api.test on the server, testsuite.test, kex.test, auth.test and every script on both halves; unit.test and regress.test stay. - Gate unit.c's wolfSSH_SFTP_read() tests on the server and share their want-read IORecv mock with the client tests below them.
regress.test now builds and runs in a --disable-client tree. The cases that drive a client session are compiled only when the client half is, matching the NO_WOLFSSH_SERVER gates already around the server cases. Without the client, IsMessageAllowed() denies every message, so those cases asserted against a session that refuses everything. - Gate the message-policy run, the disconnect and shutdown families, the EXT_INFO and algorithm-negotiation cases, and their driver calls. - Mark the seven helpers whose only callers are now gated out WS_MAYBE_UNUSED rather than move them.
EXT_INFO is a transport-generic message, so a server session parses it too, RFC 8308 section 2.3. These cases call DoExtInfo() directly and never reach the message filter, so they run in a server-only build as well as a client-only one, keeping the name-list bounds covered on both sides.
ejohnstown
force-pushed
the
no-client-no-server
branch
from
September 18, 2026 22:57
b182fcf to
263efae
Compare
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.
Both one-sided builds link and run their tests again. --disable-server was broken by a server-gated wolfSSH_RealPath() and by test programs that link examples/echoserver; --disable-client by test cases that drive a client session.