Files
tty7/crates
l0ng-ai ec7a7a2fa5 fix(ssh): a forward with no bind address binds loopback, not the resolver's guess
Three forms build a port forward: the settings sheet, the side panel, and
a `LocalForward` line read out of `~/.ssh/config`. Two of them turned a
blank bind address into `127.0.0.1`. The settings sheet passed the empty
string through to the bind.

Where that lands is not ours to decide once it leaves: `""` is whatever
getaddrinfo makes of it. On macOS and glibc today that is loopback, which
is why nothing looked wrong — but it is the resolver's answer, not the
app's, and under `AI_PASSIVE` semantics the same string means every
interface. An SSH tunnel reachable from the network is not a state to
arrive at through a default nobody chose, and the sheet's own field
already shows "localhost" as its placeholder, so a user leaving it blank
has been told what they are getting.

The side panel's `collect` claimed, in its doc, to apply "the same
conditions the settings sheet's `ForwardRuleForm::collect` applies". It
did not, and that is the sort of comment that stops anyone checking. Both
now call one function beside `HostPort`, along with the ssh_config
parser, which had the third copy of the same literal.

Tested from both ends: the rule the settings sheet builds from a blank
field, and the rule the side panel builds from the same blank, are
asserted equal — and against the unfixed sheet the first half fails.
2026-08-22 23:15:52 +08:00
..