From 3b16d1d3fbd221724378475085a1170997d732b5 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 30 Sep 2012 18:26:48 +0200 Subject: Explicitly use gpg2 rather than relying on symlink. --- src/password-store.sh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/password-store.sh') diff --git a/src/password-store.sh b/src/password-store.sh index 503bac4..e4e622e 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -119,7 +119,6 @@ tmpdir() { fi } -GPG="gpg" GETOPT="getopt" # source /path/to/platform-defined-functions @@ -160,7 +159,7 @@ case "$command" in if [[ $reencrypt -eq 1 ]]; then find "$PREFIX" -iname '*.gpg' | while read passfile; do - $GPG -d $GPG_OPTS "$passfile" | $GPG -e -r "$gpg_id" -o "$passfile.new" $GPG_OPTS && + gpg2 -d $GPG_OPTS "$passfile" | gpg2 -e -r "$gpg_id" -o "$passfile.new" $GPG_OPTS && mv -v "$passfile.new" "$passfile" done git_add_file "$PREFIX" "Reencrypted entire store using new GPG id $gpg_id." @@ -222,9 +221,9 @@ case "$command" in exit 1 fi if [[ $clip -eq 0 ]]; then - exec $GPG -d $GPG_OPTS "$passfile" + exec gpg2 -d $GPG_OPTS "$passfile" else - clip "$($GPG -d $GPG_OPTS "$passfile" | head -n 1)" "$path" + clip "$(gpg2 -d $GPG_OPTS "$passfile" | head -n 1)" "$path" fi fi ;; @@ -257,7 +256,7 @@ case "$command" in if [[ $multiline -eq 1 ]]; then echo "Enter contents of $path and press Ctrl+D when finished:" echo - $GPG -e -r "$ID" -o "$passfile" $GPG_OPTS + gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS elif [[ $noecho -eq 1 ]]; then while true; do read -p "Enter password for $path: " -s password @@ -265,7 +264,7 @@ case "$command" in read -p "Retype password for $path: " -s password_again echo if [[ $password == $password_again ]]; then - $GPG -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$password" + gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$password" break else echo "Error: the entered passwords do not match." @@ -273,7 +272,7 @@ case "$command" in done else read -p "Enter password for $path: " -e password - $GPG -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$password" + gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$password" fi git_add_file "$passfile" "Added given password for $path to store." ;; @@ -295,11 +294,11 @@ case "$command" in action="Added" if [[ -f $passfile ]]; then - $GPG -d -o "$tmp_file" $GPG_OPTS "$passfile" || exit 1 + gpg2 -d -o "$tmp_file" $GPG_OPTS "$passfile" || exit 1 action="Edited" fi ${EDITOR:-vi} "$tmp_file" - while ! $GPG -e -r "$ID" -o "$passfile" $GPG_OPTS "$tmp_file"; do + while ! gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS "$tmp_file"; do echo "GPG encryption failed. Retrying." sleep 1 done @@ -337,7 +336,7 @@ case "$command" in pass="$(pwgen -s $symbols $length 1)" [[ -n $pass ]] || exit 1 - $GPG -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$pass" + gpg2 -e -r "$ID" -o "$passfile" $GPG_OPTS <<<"$pass" git_add_file "$passfile" "Added generated password for $path to store." if [[ $clip -eq 0 ]]; then -- cgit v1.2.3-70-g09d2 /log/plugins/shutdown.xml?h=0.13&id=f9b5364f7e3c0443e06976edf3987b412e15bea9&follow=1'>Collapse)AuthorFilesLines 2008-01-14(no commit message)Necoro10-758/+1014 2008-01-14 r621@Devoty: necoro | 2008-01-14 20:21:40 +0100Necoro2-21/+61 adjust changelog r622@Devoty: necoro | 2008-01-14 21:01:11 +0100 Some new views 2008-01-14 r618@Devoty: necoro | 2008-01-14 20:19:05 +0100Necoro2-35/+57 An ALL category 2008-01-14 r617@Devoty: necoro | 2008-01-14 19:12:59 +0100Necoro2-10/+10 Remove unnecessairy loads of the shm module 2008-01-14 r609@Devoty: necoro | 2008-01-14 17:04:38 +0100Necoro9-394/+477 Allowed '-' and '_' in key names. Also use group names instead of their number. r610@Devoty: necoro | 2008-01-14 17:05:42 +0100 Disabled saving of the queues r611@Devoty: necoro | 2008-01-14 17:08:53 +0100 Added the possibility to permanently en-/disable plugins r612@Devoty: necoro | 2008-01-14 17:14:09 +0100 adjust changelog and translations r613@Devoty: necoro | 2008-01-14 17:40:53 +0100 Dropdown should be localized too 2008-01-14 r605@Devoty: necoro | 2008-01-14 11:43:34 +0100Necoro2-26/+129 Updated shm module to version 1.1.4 2008-01-14 r603@Devoty: necoro | 2008-01-14 11:30:26 +0100Necoro4-26/+38 Improved 'update world'; really support new use defaults 2008-01-11 r598@Devoty: necoro | 2008-01-10 16:36:29 +0100Necoro4-10/+50 Handle the new useflag format correctly 2008-01-11 r597@Devoty: necoro | 2008-01-10 14:12:35 +0100Necoro1-3/+3 updated todo 2008-01-10 r595@Devoty: necoro | 2008-01-10 04:04:15 +0100Necoro1-52/+3 Re-Introduced etc-proposals 2008-01-09 r586@Devoty: necoro | 2008-01-09 14:54:18 +0100Necoro1-1/+1 Disabled catapult till it is really usable 2007-12-06 r577@Devoty: necoro | 2007-12-06 20:37:36 +0100Necoro1-1/+1 Fixed desktop file 2007-12-06 r572@Devoty: necoro | 2007-11-28 08:48:15 +0100Necoro1-0/+1 2007-11-27 r570@Devoty: necoro | 2007-11-27 02:08:21 +0100Necoro3-84/+108 Added scrollbars to update window