Merge pull request #182789 from talyz/sshd-dont-delete-symlinks

sshd: Don't remove symlinks to host key files
This commit is contained in:
Bernardo Meurer 2022-07-25 21:51:46 -07:00 committed by GitHub
commit 1cfb6dab0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -442,7 +442,9 @@ in
${flip concatMapStrings cfg.hostKeys (k: ''
if ! [ -s "${k.path}" ]; then
rm -f "${k.path}"
if ! [ -h "${k.path}" ]; then
rm -f "${k.path}"
fi
ssh-keygen \
-t "${k.type}" \
${if k ? bits then "-b ${toString k.bits}" else ""} \