mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 03:56:01 +01:00
libstore: fixup fakeSSH check
This broke invocations like:
NIX_SSHOPTS='-p2222 -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no' nix copy /nix/store/......-foo --to ssh-ng://root@localhost
In Nix 2.30.2, fakeSSH was enabled when the "thing I want to connect to"
was plain old "localhost". Previously, this check was written as:
, fakeSSH(host == "localhost")
Given the above invocation, `host` would have been `root@localhost`, and
thus `fakeSSH` would be `false` because `root@localhost` != `localhost`.
However, since 49ba06175e, `authority.host`
returned _just_ the host (`localhost`, no user) and erroneously enabled
`fakeSSH` in this case, causing `NIX_SSHOPTS` to be ignored (since,
when `fakeSSH` is `true`, `SSHMaster::startCommand` doesn't call
`addCommonSSHOpts`).
`authority.to_string()` accurately returns the expected `root@localhost`
format (given the above invocation), fixing this.
(cherry picked from commit 7ec1427fc3)
This commit is contained in:
parent
80f2ca4015
commit
823c630b2e
1 changed files with 1 additions and 1 deletions
|
|
@ -78,7 +78,7 @@ SSHMaster::SSHMaster(
|
|||
oss << authority.host;
|
||||
return std::move(oss).str();
|
||||
}())
|
||||
, fakeSSH(authority.host == "localhost")
|
||||
, fakeSSH(authority.to_string() == "localhost")
|
||||
, keyFile(keyFile)
|
||||
, sshPublicHostKey(parsePublicHostKey(authority.host, sshPublicHostKey))
|
||||
, useMaster(useMaster && !fakeSSH)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue