summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2014-04-15 17:48:19 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2014-04-15 17:48:19 +0200
commit98a9867ff6e202b159861f2cd527395d7d5d6685 (patch)
treef2ba61fa486965e3a8457691e1cc6509bade650d
parentc0df57a3543e79cb9b5effe62054d5415f70e837 (diff)
downloadpass-98a9867ff6e202b159861f2cd527395d7d5d6685.tar.gz
pass-98a9867ff6e202b159861f2cd527395d7d5d6685.tar.bz2
pass-98a9867ff6e202b159861f2cd527395d7d5d6685.zip
Check for agent before batch processes
-rwxr-xr-xsrc/password-store.sh23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 4daf8fa..ac3e20b 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -65,6 +65,16 @@ set_gpg_recipients() {
GPG_RECIPIENT_ARGS+=( "-r" "$gpg_id" )
done < "$current"
}
+agent_check() {
+ [[ -n $GPG_AGENT_INFO ]] || yesno "$(cat <<-_EOF
+ You are not running gpg-agent. This means that you will
+ need to enter your password for each and every gpg file
+ that pass processes. This could be quite tedious.
+
+ Are you sure you would like to continue without gpg-agent?
+ _EOF
+ )"
+}
#
# END helper functions
@@ -105,10 +115,14 @@ tmpdir() {
if [[ -d /dev/shm && -w /dev/shm && -x /dev/shm ]]; then
SECURE_TMPDIR="$(TMPDIR=/dev/shm mktemp -d -t "$template")"
else
- yesno "$(echo "Your system does not have /dev/shm, which means that it may"
- echo "be difficult to entirely erase the temporary non-encrypted"
- echo "password file after editing. Are you sure you would like to"
- echo -n "continue?")"
+ yesno "$(cat <<-_EOF
+ Your system does not have /dev/shm, which means that it may
+ be difficult to entirely erase the temporary non-encrypted
+ password file after editing.
+
+ Are you sure you would like to continue?
+ _EOF
+ )"
SECURE_TMPDIR="$(mktemp -d -t "$template")"
fi
@@ -214,6 +228,7 @@ cmd_init() {
git_add_file "$gpg_id" "Set GPG id to ${id_print%, }."
if [[ $reencrypt -eq 1 ]]; then
+ agent_check
local passfile
find "$PREFIX/$id_path" -iname '*.gpg' | while read -r passfile; do
fake_uniqueness_safety="$RANDOM"
to.git/commit/portato/plugins/etc_proposals.py?h=v0.13&id=e42090a8bd7dcc5f9e7c6e41b0f44698588e6586&follow=1'>Ported etc-proposals pluginRené 'Necoro' Neumann3-50/+43 2008-07-03Ported gpytage pluginRené 'Necoro' Neumann2-16/+14 2008-07-03Ported Notify pluginRené 'Necoro' Neumann4-37/+51 2008-07-03Remove xsd and -x cmdline optionRené 'Necoro' Neumann2-107/+1 2008-07-03Ported completelyRené 'Necoro' Neumann3-548/+54 2008-07-03Should show dependencies nowRené 'Necoro' Neumann2-82/+128 2008-07-03New plugin system - first hackRené 'Necoro' Neumann2-420/+683 2008-06-30Now the new design is able to do the same as the old oneRené 'Necoro' Neumann3-168/+182 2008-06-30First draft of the new plugin windowRené 'Necoro' Neumann1-8/+172 2008-06-30Added stuff to plugin.pyRené 'Necoro' Neumann1-2/+24 2008-06-25Now load 22 versions when running the correct portageRené 'Necoro' Neumann4-8/+18 2008-06-25Added Package_22 and System_22René 'Necoro' Neumann4-5/+63