Skip to content

fix: cherry-pick upstream fixes from gliderlabs/ssh - #51

Merged
taciturnaxolotl merged 6 commits into
masterfrom
upstream-fixes
Jul 30, 2026
Merged

fix: cherry-pick upstream fixes from gliderlabs/ssh#51
taciturnaxolotl merged 6 commits into
masterfrom
upstream-fixes

Conversation

@taciturnaxolotl

@taciturnaxolotl taciturnaxolotl commented Jul 30, 2026

Copy link
Copy Markdown
Member

Cherry-picks six fixes from upstream gliderlabs/ssh that address several bugs:

mfielding and others added 2 commits July 29, 2026 21:47
From https://staticcheck.dev/docs/checks#SA4011:

SA4011 - Break statement with no effect. Did you mean to break out of an outer loop?

In Go, the break statement only exits the innermost loop it's currently in. If you're seeing the "ineffective break statement" warning, it's likely because you have a break statement inside a nested loop, but you intended to exit the outer loop.

Updating with a `return` to exit the goroutine entirely.  The unit test itself isn't affected;  it passes before and after this change.
On my system, the message wasn't being printed when `sftp` connection exited
(I types `exit` in sftp). Let me know if I misunderstood something.
@coveralls

coveralls commented Jul 30, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 30506992601

Coverage decreased (-0.08%) to 62.381%

Details

  • Coverage decreased (-0.08%) from the base build.
  • Patch coverage: 5 uncovered changes across 2 files (7 of 12 lines covered, 58.33%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
server.go 9 6 66.67%
session.go 3 1 33.33%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1260
Covered Lines: 786
Line Coverage: 62.38%
Coverage Strength: 462.59 hits per line

💛 - Coveralls

Yanhu007 and others added 4 commits July 29, 2026 21:54
When a server only defines SubsystemHandlers (e.g. SFTP) without
a session Handler, an SSH client sending a shell or exec request
causes a nil pointer dereference panic at session.go:261.

Add a nil check for sess.handler before accepting the request.
When nil, the request is rejected with Reply(false, nil) instead
of crashing.

Fixes gliderlabs#237
This error can be used in ConnectionFailedCallback to know error with
error.Is().
only disable client auth when it's explicitly disabled or the auth callkbacks on both `*Server` and `ServerConfig` are nil
@taciturnaxolotl
taciturnaxolotl merged commit 4bc63b0 into master Jul 30, 2026
10 checks passed
@taciturnaxolotl
taciturnaxolotl deleted the upstream-fixes branch July 30, 2026 01:56
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.

7 participants