Repository navigation
v3.2.0
ssh-config v3.2.0
Version 3.2.0 is a bug-fix release. It closes the paths that dropped, renamed,
or rewrote configuration without saying so, and it removes two ways a run could
stall or fail outright. Every change is a fix; the minor bump is there for one
additive Go API change, described below.
There are no schema changes, and nothing was removed or given a new meaning, so
existing code, configuration, YAML, and JSON keep working. One input is an
exception: legacy JSON whose global entries set the same keyword to conflicting
values is now refused by -to-yaml, described under Behavior changes.
Configuration is no longer lost silently
- An empty standard input is refused instead of replacing the destination.
Reading from a pipe treated an empty stream as an empty configuration and
atomically replaced-dest, so a failed upstream command in a pipeline
truncated the destination file, frequently~/.ssh/config.ssh-confignow
reports the empty input and exits non-zero, leaving the destination alone. - A NUL byte no longer ends the scan. The lexer used
0to signal end of
input, so the first NUL byte in a source file was read as the end of the
file and every directive after it was dropped without a diagnostic. End of
input is now a separate sentinel that cannot collide with an input byte. - The implicit
~/.sshscan reads only conventional configuration paths. With
-legacyand no-src, the scan considersconfigandconfig.d/*. An
unrelated file kept in~/.sshis no longer read in full, and its comments
are no longer reproduced asNotesin the output. A directory named
explicitly with-srcis the caller's own choice and is still scanned in
full, whatever its files are named.
Conversions round-trip correctly
-to-jsonkeeps the group prefix. The JSON schema is a flat host list with
no group concept, so a group prefix has to be folded into the name the way
-to-sshdoes it. Emitting the bare name silently renamed every host in a
prefixed group.- The legacy YAML view no longer contradicts the configuration
sshapplies.
ssh_config(5)uses the first value obtained for each keyword, but the
globalmapping was built with last-wins, so two*entries setting the
same keyword made-to-yamlreport the valuesshwould not use. Entries
are now merged first-obtained-value, and-to-yamlrefuses input whose
globals that single mapping cannot represent at all instead of picking one
of two conflicting values. This reaches legacy JSON input and direct Go
callers; SSH text carrying twoHost *blocks was already refused as a
duplicate block for every output format.-to-sshand-to-jsonrepresent
the entries separately and keep working on the same input. - The schema keeps a directive's original indentation when it re-renders a
line, instead of flattening an indented directive to the left margin. QuoteArgumentrenders every argument so that reparsing returns it
unchanged. An argument beginning with=is quoted, because the parser
consumes one=directly after the keyword as a separator and would
otherwise return the value with the=stripped. Quoting now walks bytes
rather than runes, so an argument holding arbitrary bytes survives a
reparse; the previous renderer decoded invalid UTF-8 asutf8.RuneError
and wrote U+FFFD in its place, which also affected arguments containing a
space, a quote, or a backslash.
Runs no longer stall or fail on input OpenSSH accepts
- Legacy YAML duplicate validation no longer re-walks shared aliases. A
document using YAML anchors re-validated the same nodes once per reference,
so the work grew with alias depth rather than document size; a 513-byte
document did not finish in twenty minutes. Validation results are memoized
per node and the same document now completes in milliseconds. Includeskips glob matches that cannot be configuration files. A pattern
matching a subdirectory or a dangling symbolic link failed the whole
resolution, although OpenSSH ignores such matches. Skipped matches are
recorded on the resolved document graph so a caller can still see them.
Command line
-his an alias for-help. Onlyhelpwas registered, so-hfell
through to the flag package's built-in handling and printed a generated
option listing on standard error, while-helpprinted the documented usage
on standard output. Both spellings now print the same text on standard
output.
Go API
sshconfig.SkippedIncludeandDocumentGraph.Skippedare new, so a caller
can see which glob matches theIncluderesolver passed over and why.
Nothing was removed and no existing declaration changed, so code built
against v3.1.0 compiles unchanged. This addition is the whole reason the
version is a minor rather than a patch.
Behavior changes
These are deliberate and user-visible. Each replaces a silent wrong answer
with a correct one or with a refusal.
- Empty standard input is an error; it previously wrote an empty destination.
-legacywithout-srcno longer reads arbitrary files in~/.ssh. Pass
the directory explicitly with-src ~/.sshto keep the previous scan.-to-yamlfails on legacy JSON input whose global entries set one keyword
to conflicting values; it previously emitted one of them.-to-sshand
-to-jsonare unaffected.-hwrites the documented usage to standard output rather than a generated
listing to standard error.
Verification
The release candidate must pass unit tests, the race detector, vet,
govulncheck, OpenSSH integration tests, a GoReleaser snapshot, and container
smoke checks before the final tag is created. The tagged Go module consumer
test is not part of that gate: it runs afterwards, in the publishing workflow,
because it installs the module at a tag that does not exist until the candidate
has passed. See the release process for the order in
which the candidate gate and the tag are created.
This document is also used as the curated GitHub Release body. The full commit
comparison remains available through the link appended by GoReleaser.
Full Changelog: v3.1.0...v3.2.0