commit 8c71c10b0a8066cf0dc6bc5e0c5583eaddbb5441
parent 80aee073122c63d1b570dc32e4490909ff15753b
Author: pierre <yonkou@tutanota.com>
Date: Tue, 25 May 2021 16:05:16 -0400
password store with multiple private keys fix
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/bin/mw b/bin/mw
@@ -18,8 +18,7 @@ done || { echo "CA Certificate not found. Please install one or link it to /etc/
checkbasics() { command -V gpg >/dev/null 2>&1 && GPG="gpg" || GPG="gpg2"
PASSWORD_STORE_DIR="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
- [ -r "$PASSWORD_STORE_DIR/.gpg-id" ] &&
- "$GPG" --list-secret-keys "$(cat "$PASSWORD_STORE_DIR/.gpg-id")" >/dev/null 2>&1 || {
+ [ -r "$PASSWORD_STORE_DIR/.gpg-id" ] || {
echo "First run \`pass init <yourgpgemail>\` to set up a password archive."
echo "(If you don't already have a GPG key pair, first run \`$GPG --full-generate-key\`.)"
exit 1 ;} ;}
@@ -204,7 +203,7 @@ askinfo() { \
}
createpass() { echo "$password" > "$PASSWORD_STORE_DIR/$fulladdr"
- "$GPG" -qer "$(cat "$PASSWORD_STORE_DIR/.gpg-id")" "$PASSWORD_STORE_DIR/$fulladdr"
+ "$GPG" -qe $(printf -- " -r %s" $(cat "$PASSWORD_STORE_DIR/.gpg-id")) "$PASSWORD_STORE_DIR/$fulladdr"
rm -f "$PASSWORD_STORE_DIR/$fulladdr" ;}
getpass() { while : ; do pass rm -f "$fulladdr" >/dev/null 2>&1