diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-04-18 01:31:47 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-04-18 01:31:47 +0200 |
commit | 75929df06ef93bef65f2911359341972726f6be4 (patch) | |
tree | df1a8ddeb933788c3e126393ce6e85b184cc288c | |
parent | ebd57647fa54721ec64aba47c79819ad270b3a63 (diff) |
reencryption: remove temporary file on failure
-rwxr-xr-x | src/password-store.sh | 2 |
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[@]}" |