Skip to content

Comments

[Backport 2.31-maintenance] libstore: fixup fakeSSH check#14178

Merged
internal-nix-ci[bot] merged 1 commit into2.31-maintenancefrom
backport-14150-to-2.31-maintenance
Oct 7, 2025
Merged

[Backport 2.31-maintenance] libstore: fixup fakeSSH check#14178
internal-nix-ci[bot] merged 1 commit into2.31-maintenancefrom
backport-14150-to-2.31-maintenance

Conversation

@internal-nix-ci
Copy link

Automatic backport to 2.31-maintenance, triggered by a label in #14150.

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 49ba061, `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 7ec1427)
@internal-nix-ci internal-nix-ci bot requested a review from Ericson2314 as a code owner October 7, 2025 21:37
@internal-nix-ci internal-nix-ci bot enabled auto-merge October 7, 2025 21:37
@internal-nix-ci internal-nix-ci bot merged commit e857484 into 2.31-maintenance Oct 7, 2025
17 checks passed
@internal-nix-ci internal-nix-ci bot deleted the backport-14150-to-2.31-maintenance branch October 7, 2025 22:12
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.

1 participant