Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssh: put custom options before generated options #53767

Merged
merged 1 commit into from Feb 19, 2019

Conversation

kwohlfahrt
Copy link
Contributor

Otherwise, the standard options (e.g. AddressFamily) cannot be overriden
in extraConfig, as the option is applied on the first (not most
specific) match. Closes #52267

Motivation for this change

See bug #52267

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.


subtest "configuration", sub {
$client->succeed("ssh -G other_server | grep -i 'addressfamily any'");
$client->succeed("ssh -G example_server | grep -i 'addressfamily inet'");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we need an extra test for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, will drop that commit.

@@ -203,6 +203,9 @@ in
# generation in the sshd service.
environment.etc."ssh/ssh_config".text =
''
${cfg.extraConfig}
Copy link
Member

@Mic92 Mic92 Jan 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
${cfg.extraConfig}
# To allow users to override existing configuration, we prepend `extraConfig`.
${cfg.extraConfig}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment aimed at people inspecting /etc/ssh/ssh_config, or people reading ssh.nix?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right. Your version makes more sense.

@kwohlfahrt
Copy link
Contributor Author

@Mic92 I think I have addressed your comments

@Mic92
Copy link
Member

Mic92 commented Jan 11, 2019

@GrahamcOfBorg build nixosTests.openssh

@kwohlfahrt
Copy link
Contributor Author

@Mic92 - any update on this?

@@ -203,6 +203,9 @@ in
# generation in the sshd service.
environment.etc."ssh/ssh_config".text =
''
${cfg.extraConfig}

Host *
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Host * is so the following config options apply to all hosts if they haven't been set before. For example if cfg.extraConfig is:

Host example.com
    Port 10022

then the options below would only apply to example.com without the Host * - ssh options are not indentation sensitive, that is just for readability.

@infinisil
Copy link
Member

Can you squash the commits together? And then the commit message should have the "nixos/ssh:" prefix instead.

Otherwise, the standard options (e.g. AddressFamily) cannot be overriden
in extraConfig, as the option is applied on the first (not most
specific) match. Closes NixOS#52267
@kwohlfahrt
Copy link
Contributor Author

@infinisil rebased onto master and squashed commits

@infinisil infinisil merged commit 266315c into NixOS:master Feb 19, 2019
@kwohlfahrt kwohlfahrt deleted the ssh branch March 27, 2019 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants