sshd: Use top-level ports in config check when needed

Previously, if a listenAddress was specified without a `port`, the check
would fail.
This commit is contained in:
Bryan Richter 2023-12-20 13:59:00 +02:00
parent fa5d6d1a6c
commit e797aaea0b
No known key found for this signature in database
GPG Key ID: B202264020068BFB

View File

@ -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
'')