diff options
| author | Bryan Richter <b@chreekat.net> | 2023-12-20 13:59:00 +0200 |
|---|---|---|
| committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2024-01-03 15:25:38 +0000 |
| commit | d7d2e2978b2b00f952995799976adc4507fb0bb2 (patch) | |
| tree | fd7389e1f283a5f18aed1e8fb870e2bf45a1b363 | |
| parent | Merge pull request #278445 from NixOS/backport-269598-to-release-23.11 (diff) | |
| download | nixpkgs-origin/backport-275633-to-release-23.11.tar.gz | |
sshd: Use top-level ports in config check when neededorigin/backport-275633-to-release-23.11
Previously, if a listenAddress was specified without a `port`, the check
would fail.
(cherry picked from commit e797aaea0bca078f54868950128bdf16721eaa59)
| -rw-r--r-- | nixos/modules/services/networking/ssh/sshd.nix | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix index f54ce5917438..39793922ab51 100644 --- a/nixos/modules/services/networking/ssh/sshd.nix +++ b/nixos/modules/services/networking/ssh/sshd.nix @@ -674,7 +674,11 @@ in (lport: "sshd -G -T -C lport=${toString lport} -f ${sshconf} > /dev/null") cfg.ports} ${concatMapStringsSep "\n" - (la: "sshd -G -T -C ${escapeShellArg "laddr=${la.addr},lport=${toString la.port}"} -f ${sshconf} > /dev/null") + (la: + concatMapStringsSep "\n" + (port: "sshd -G -T -C ${escapeShellArg "laddr=${la.addr},lport=${toString port}"} -f ${sshconf} > /dev/null") + (if la.port != null then [ la.port ] else cfg.ports) + ) cfg.listenAddresses} touch $out '') |
