mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-10-31 06:31:20 +00:00
fix: ssh-keygen fails if directory does not exist
This commit is contained in:
parent
b74d6cd93f
commit
d8b356caaf
@ -435,13 +435,12 @@ in
|
||||
# socket activation, it goes to the remote side (#19589).
|
||||
exec >&2
|
||||
|
||||
mkdir -m 0755 -p /etc/ssh
|
||||
|
||||
${flip concatMapStrings cfg.hostKeys (k: ''
|
||||
if ! [ -s "${k.path}" ]; then
|
||||
if ! [ -h "${k.path}" ]; then
|
||||
rm -f "${k.path}"
|
||||
fi
|
||||
mkdir -m 0755 -p "$(dirname '${k.path}')"
|
||||
ssh-keygen \
|
||||
-t "${k.type}" \
|
||||
${if k ? bits then "-b ${toString k.bits}" else ""} \
|
||||
|
Loading…
Reference in New Issue
Block a user