Use fd 3 for retrieving password in encrypt function instead of command line arg.

This commit is contained in:
drduh 2015-07-03 14:54:08 -04:00
parent bee78f773f
commit 871f6d25f7
1 changed files with 3 additions and 3 deletions

6
pwd.sh
View File

@ -57,11 +57,11 @@ decrypt () {
encrypt () {
# Encrypt with a password.
# TODO(drduh): don't retrieve passphrase as arg
${gpg} \
--symmetric --armor --batch --yes \
--command-fd 0 --passphrase "${1}" \
--output "${2}" "${3}" 2>/dev/null
--passphrase-fd 3 \
--output "${2}" "${3}" 3< <(echo "${1}")
}