summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsrc/password-store.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 0d03520..a7a5604 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -4,6 +4,7 @@
# This file is licensed under the GPLv2+. Please see COPYING for more information.
umask "${PASSWORD_STORE_UMASK:-077}"
+set -o pipefail
GPG_OPTS="--quiet --yes --compress-algo=none"
GPG="gpg"
@@ -209,12 +210,13 @@ case "$command" in
if [[ $reencrypt -eq 1 ]]; then
find "$PREFIX/$id_path" -iname '*.gpg' | while read -r passfile; do
+ fake_uniqueness_safety="$RANDOM"
passfile_dir=${passfile%/*}
passfile_dir=${passfile_dir#$PREFIX}
passfile_dir=${passfile_dir#/}
set_gpg_recipients "$passfile_dir"
- $GPG -d $GPG_OPTS "$passfile" | $GPG -e "${gpg_recipient_args[@]}" -o "$passfile.new" $GPG_OPTS &&
- mv -v "$passfile.new" "$passfile"
+ $GPG -d $GPG_OPTS "$passfile" | $GPG -e "${gpg_recipient_args[@]}" -o "$passfile.new.$fake_uniqueness_safety" $GPG_OPTS &&
+ mv -v "$passfile.new.$fake_uniqueness_safety" "$passfile"
done
git_add_file "$PREFIX/$id_path" "Reencrypted password store using new GPG id ${id_print}."
fi
dfadd43a901d0170acecb8e8c0c&follow=1'>Don't define tmpdir on git init.Jason A. Donenfeld1-4/+3 2014-05-14Disable secmem warning when discovering keysmilki2-2/+2 2014-05-10edit: Quote editor so tests work in spaced directories.Jason A. Donenfeld1-1/+1 2014-05-10reencryption: Properly escape input to sedJason A. Donenfeld1-1/+1 2014-05-10git: use secure tmp directoryJason A. Donenfeld1-4/+11 2014-05-10configure git to decrypt gpg files automaticallySamuel Le Thiec1-0/+5 2014-05-08completion: add new generate flagsJason A. Donenfeld3-2/+7 2014-05-08inplace: mutually exclusive with forceJason A. Donenfeld2-3/+3 2014-05-08usage: tab to spacesJason A. Donenfeld1-1/+1 2014-05-08generate: use nice ansi colors instead.Jason A. Donenfeld1-3/+2 2014-05-08zsh: posix compatible sed fix for zsh-completionJason A. Donenfeld1-1/+1 2014-05-07Implement interactive init functionSvend Sorensen1-0/+8 2014-05-07Implement interactive rename functionSvend Sorensen1-0/+7 2014-05-07Reorder interactive function to match order of helper functionsSvend Sorensen1-13/+13 2014-05-07Make edit helper function name consistent with other helpersSvend Sorensen1-1/+1 2014-05-07Factor out password completing-read functionSvend Sorensen1-4/+8 2014-05-07Add dash to Package-RequiresSvend Sorensen1-1/+1 2014-05-06Force sane sort order.Jason A. Donenfeld1-2/+2 2014-05-06generate: add --in-place optionJason A. Donenfeld4-9/+33