From cca11e871c9d1d1a118e688d107cb27e9e197567 Mon Sep 17 00:00:00 2001 From: Tails developers Date: Sat, 3 Nov 2012 18:31:28 +0100 Subject: Create temp file in the same directory as the file it'll replace to get an atomic update in export-key --- templates/reprepro-export-key.sh.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/reprepro-export-key.sh.erb b/templates/reprepro-export-key.sh.erb index 2b25df2..7b3c2ed 100644 --- a/templates/reprepro-export-key.sh.erb +++ b/templates/reprepro-export-key.sh.erb @@ -6,7 +6,7 @@ KEY="$(gpg --homedir '<%= @basedir %>/.gnupg' --with-colon --list-secret-keys | cut -d : -f 5 | head -n 1)" if [ -n "$KEY" ]; then - TEMPFILE=$(mktemp) + TEMPFILE=$(mktemp --tmpdir='<%= @basedir %>') trap "rm -f '$TEMPFILE'" EXIT DESTFILE='<%= @basedir %>/key.asc' gpg --homedir '<%= @basedir %>/.gnupg' --export --armor "$KEY" > "$TEMPFILE" -- cgit v1.2.3