diff options
| author | tv <tv@krebsco.de> | 2026-11-18 12:57:20 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-18 14:17:52 +0100 |
| commit | 7da69dc9a02d57ae47bdd10ca52ceb7d0382ed7e (patch) | |
| tree | da8d8b8ce90c5615ce0b20cb2068d71d1723a2b6 /modules/systemd-credentials.nix | |
| parent | d2f2de4accd296f51abaacdae55e9db8d3587fd1 (diff) | |
systemd-credentials: update the cache atomically
Make the temporary file next to the cache, so mv renames it rather
than copying it from /tmp.
Diffstat (limited to 'modules/systemd-credentials.nix')
| -rw-r--r-- | modules/systemd-credentials.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/systemd-credentials.nix b/modules/systemd-credentials.nix index 5e3bfe9..0927f71 100644 --- a/modules/systemd-credentials.nix +++ b/modules/systemd-credentials.nix @@ -59,7 +59,7 @@ ]} cache=/var/lib/credentials/${mylib.shell.escape serviceName}.sha1sum - tmpfile=$(mktemp -t "$(basename "$cache")".XXXXXXXX) + tmpfile=$(mktemp "$cache.XXXXXXXX") trap 'rm -f "$tmpfile"' EXIT sha1sum ${toString cfg.credentialPaths} > "$tmpfile" |
