pash: don't overwrite GPG_TTY if set
This commit is contained in:
parent
b52122a071
commit
f163bb91ed
4
pash
4
pash
@ -44,7 +44,7 @@ pw_add() {
|
|||||||
# Use 'gpg' to store the password in an encrypted file. The
|
# Use 'gpg' to store the password in an encrypted file. The
|
||||||
# 'GPG_TTY' environment variable is set to workaround cases
|
# 'GPG_TTY' environment variable is set to workaround cases
|
||||||
# where 'gpg' cannot find an attached terminal.
|
# where 'gpg' cannot find an attached terminal.
|
||||||
echo "$pass" | GPG_TTY=$(tty) "$gpg" "$@" -o "$name.gpg" &&
|
echo "$pass" | "$gpg" "$@" -o "$name.gpg" &&
|
||||||
printf '%s\n' "Saved '$name' to the store."
|
printf '%s\n' "Saved '$name' to the store."
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,6 +176,8 @@ main() {
|
|||||||
glob "$2" '*/*' && { mkdir -p "${2%/*}" ||
|
glob "$2" '*/*' && { mkdir -p "${2%/*}" ||
|
||||||
die "Couldn't create category '${2%/*}'."; }
|
die "Couldn't create category '${2%/*}'."; }
|
||||||
|
|
||||||
|
export GPG_TTY=${GPG_TTY:-$(tty)}
|
||||||
|
|
||||||
umask 077
|
umask 077
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
|
Loading…
Reference in New Issue
Block a user