summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2014-04-18 01:31:47 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2014-04-18 01:31:47 +0200
commit75929df06ef93bef65f2911359341972726f6be4 (patch)
treedf1a8ddeb933788c3e126393ce6e85b184cc288c /src
parentebd57647fa54721ec64aba47c79819ad270b3a63 (diff)
downloadpass-75929df06ef93bef65f2911359341972726f6be4.tar.gz
pass-75929df06ef93bef65f2911359341972726f6be4.tar.bz2
pass-75929df06ef93bef65f2911359341972726f6be4.zip
reencryption: remove temporary file on failure
Diffstat (limited to '')
-rwxr-xr-xsrc/password-store.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 0828a32..598d1bf 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -108,7 +108,7 @@ reencrypt_path() {
if [[ $gpg_keys != "$current_keys" ]]; then
echo "$passfile_display: reencrypting to ${gpg_keys//$'\n'/ }"
$GPG -d $GPG_OPTS "$passfile" | $GPG -e "${GPG_RECIPIENT_ARGS[@]}" -o "$passfile.new.$fake_uniqueness_safety" $GPG_OPTS &&
- mv "$passfile.new.$fake_uniqueness_safety" "$passfile"
+ mv "$passfile.new.$fake_uniqueness_safety" "$passfile" || rm -f "$passfile.new.$fake_uniqueness_safety"
fi
prev_gpg_recipients="${GPG_RECIPIENTS[@]}"