The ignoreMatchDirective flag did not exist in the newConfig function.
Because this function is called when generating a config for connections
in an included file, those connections automatically assumed the value
was false. This change adds the flag so it can be changed to true if it
is also set for the outer configuration.
* Add the possibility to ignore the Match directive
* cleanup
* cleanup
* cleanup
* cleanup
* fix: duplicated code leftover from merge
* fix: match directive bypass for GetAll
The new ignoreMatchDirective flag needed to be added in one other place.
---------
Co-authored-by: fferro <francesco.ferro@yahooinc.com>
See the description in the CHANGELOG - we were handling this
incorrectly and attaching whitespace to the end of values where that
didn't make much sense to do.
Previously we used the buffruneio package to buffer input. However,
the error handling was not good, and we would often panic when parsing
inputs.
SSH config files are generally not large, on the order of kilobytes or
megabytes, and it's fine to just read the entire thing into memory and
then parse from there. This also simplifies the parser significantly
and lets us remove a dependency and several defer calls.
Add a test that panicked with the old version and then modify the code
to ensure the test no longer panics.
Thanks to Mark Nevill (@devnev) for the initial error report and
failing test case.
Fixes#10.
Fixes#24.
The error handling is nonexistent and there's no easy way to get
data out. But we can parse a SSH config file into a Go struct, and
roundtrip that struct back to a file that looks (roughly) the same.