From ec371cbeb71ad941929d6b41142dfba18eaa34a1 Mon Sep 17 00:00:00 2001 From: drduh Date: Fri, 3 Jul 2015 14:08:15 -0400 Subject: [PATCH] Retrieve passphrase from stdin with echo, instead of as a command line arg. --- pwd.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pwd.sh b/pwd.sh index 57c4c69..b44b8ff 100755 --- a/pwd.sh +++ b/pwd.sh @@ -48,18 +48,18 @@ get_pass () { decrypt () { # Decrypt with a password. - ${gpg} \ + echo "${1}" | ${gpg} \ --decrypt --armor --batch \ - --command-fd 0 --passphrase "${1}" "${2}" 2>/dev/null + --passphrase-fd 0 "${2}" 2>/dev/null } encrypt () { # Encrypt with a password. - ${gpg} \ + echo "${1}" | ${gpg} \ --symmetric --armor --batch --yes \ - --command-fd 0 --passphrase "${1}" \ + --passphrase-fd 0 \ --output "${2}" "${3}" 2>/dev/null }