From mmh at riseup.net Thu Dec 5 18:50:37 2019 From: mmh at riseup.net (mmh at riseup.net) Date: Thu, 5 Dec 2019 18:50:37 +0100 Subject: [PATCH] Enable the use of regex in show command Message-ID: <20191205175037.203464-1-mmh@riseup.net> From: mmh Instead of line numbers regular expressions can be passed to --clip and --qrcode as well. Any string which contains characters other than digits is interpretd as a regular expression. The decrypted password file in question is then piped through sed using "^regex *" as a pattern and the first line found is clipped/qrencoded. Signed-off-by: mmh --- man/pass.1 | 7 +++++-- src/password-store.sh | 11 +++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/man/pass.1 b/man/pass.1 index a555dcb..6bcdae6 100644 --- a/man/pass.1 +++ b/man/pass.1 @@ -94,7 +94,7 @@ List names of passwords inside the tree that match \fIpass-names\fP by using the .BR tree (1) program. This command is alternatively named \fBsearch\fP. .TP -\fBshow\fP [ \fI--clip\fP[=\fIline-number\fP], \fI-c\fP[\fIline-number\fP] ] [ \fI--qrcode\fP[=\fIline-number\fP], \fI-q\fP[\fIline-number\fP] ] \fIpass-name\fP +\fBshow\fP [ \fI--clip\fP[=\fIline-number\fP or \fIregex\fP], \fI-c\fP[\fIline-number\fP or \fIregex\fP] ] [ \fI--qrcode\fP[=\fIline-number\fP or \fIregex\fP], \fI-q\fP[\fIline-number\fP or \fIregex\fP] ] \fIpass-name\fP Decrypt and print a password named \fIpass-name\fP. If \fI--clip\fP or \fI-c\fP is specified, do not print the password but instead copy the first (or otherwise specified) line to the clipboard using @@ -104,7 +104,9 @@ or and then restore the clipboard after 45 (or \fIPASSWORD_STORE_CLIP_TIME\fP) seconds. If \fI--qrcode\fP or \fI-q\fP is specified, do not print the password but instead display a QR code using .BR qrencode (1) -either to the terminal or graphically if supported. +either to the terminal or graphically if supported. If the argument to \fI--clip\fP or \fI--qrcode\fP contains other characters than digits it is interpreted as a regex rather than a line-number and it is passed to +.BR sed (1) +as "^regex *". The regex must not contain "|". .TP \fBinsert\fP [ \fI--echo\fP, \fI-e\fP | \fI--multiline\fP, \fI-m\fP ] [ \fI--force\fP, \fI-f\fP ] \fIpass-name\fP Insert a new password into the password store called \fIpass-name\fP. This will @@ -467,6 +469,7 @@ The \fBinit\fP command will keep signatures of \fB.gpg-id\fP files up to date. The location of the text editor used by \fBedit\fP. .SH SEE ALSO .BR gpg2 (1), +.BR sed (1), .BR tr (1), .BR git (1), .BR xclip (1), diff --git a/src/password-store.sh b/src/password-store.sh index 77f3eda..c435c40 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -282,7 +282,7 @@ cmd_usage() { List passwords. $PROGRAM find pass-names... List passwords that match pass-names. - $PROGRAM [show] [--clip[=line-number],-c[line-number]] pass-name + $PROGRAM [show] [--clip[=line-number or regex],-c[line-number or regex]] [--qrcode[=line-number or regex],-q[line-number or regex]] pass-name Show existing password and optionally put it on the clipboard. If put on the clipboard, it will be cleared in $CLIP_TIME seconds. $PROGRAM grep [GREPOPTIONS] search-string @@ -374,7 +374,7 @@ cmd_show() { --) shift; break ;; esac done - [[ $err -ne 0 || ( $qrcode -eq 1 && $clip -eq 1 ) ]] && die "Usage: $PROGRAM $COMMAND [--clip[=line-number],-c[line-number]] [--qrcode[=line-number],-q[line-number]] [pass-name]" + [[ $err -ne 0 || ( $qrcode -eq 1 && $clip -eq 1 ) ]] && die "Usage: $PROGRAM $COMMAND [--clip[=line-number or regex],-c[line-number or regex]] [--qrcode[=line-number or regex],-q[line-number or regex]] [pass-name]" local pass local path="$1" @@ -385,8 +385,11 @@ cmd_show() { pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | $BASE64)" || exit $? echo "$pass" | $BASE64 -d else - [[ $selected_line =~ ^[0-9]+$ ]] || die "Clip location '$selected_line' is not a number." - pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | tail -n +${selected_line} | head -n 1)" || exit $? + if [[ $selected_line =~ ^[0-9]+$ ]]; then + pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | tail -n +${selected_line} | head -n 1)" || exit $? + else + pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | sed -n "s|^${selected_line} *||p" | head -n 1)" || exit $? + fi [[ -n $pass ]] || die "There is no password to put on the clipboard at line ${selected_line}." if [[ $clip -eq 1 ]]; then clip "$pass" "$path" -- 2.24.0 From gigavinyl at riseup.net Wed Dec 11 04:44:46 2019 From: gigavinyl at riseup.net (Carolyn Knight-Serrano) Date: Tue, 10 Dec 2019 19:44:46 -0800 Subject: BUG Error: q::c:: is not in the password store. Message-ID: <62fcec3f-91fe-6cd8-01ed-42d9847e690f@riseup.net> Howdy! I'm using password-store on NetBSD 9.0_RC1 and I'm getting a strange error. When I run, for example, pass newsblur.com, I get the following error: Error: q::c:: is not in the password store. From rune at juhljacobsen.dk Wed Dec 11 10:44:54 2019 From: rune at juhljacobsen.dk (Rune Juhl Jacobsen) Date: Wed, 11 Dec 2019 10:44:54 +0100 Subject: BUG Error: q::c:: is not in the password store. In-Reply-To: <62fcec3f-91fe-6cd8-01ed-42d9847e690f@riseup.net> References: <62fcec3f-91fe-6cd8-01ed-42d9847e690f@riseup.net> Message-ID: <87y2vjdwmh.fsf@juhljacobsen.dk> Hi Carolyn, Could you try running pass with `bash -x`, i.e. ```sh bash -x pass newsblur.com ``` That should give you a whole bunch of debug output from bash. /Rune Carolyn Knight-Serrano writes: > Howdy! I'm using password-store on NetBSD 9.0_RC1 and I'm > getting a strange error. When I run, for example, pass > newsblur.com, I get the following error: > > Error: q::c:: is not in the password store. > > _______________________________________________ Password-Store > mailing list Password-Store at lists.zx2c4.com > https://lists.zx2c4.com/mailman/listinfo/password-store -- Rune Juhl Jacobsen runejuhl at freenode @runejuhl:matrix.org From kjetil.homme at redpill-linpro.com Tue Dec 17 17:55:58 2019 From: kjetil.homme at redpill-linpro.com (Kjetil Torgrim Homme) Date: Tue, 17 Dec 2019 17:55:58 +0100 Subject: [PATCH] Allow comments in .gpg-id Message-ID: We are using password-store to share secrets within our organisation, so there are dozens of entries in our .gpg-id files. A list of anonymous 64-bit values is hard to work with (e.g., when a colleague leaves or a new one arrives), so I would like to allow an optional comment to each line. The current logic allows space separated fingerprints like 8239 26C1 119D DD65 CC49 4A44 7708 DF87 BE42 C343 so we must continue to support spaces in the values. It is also allowed to use a user-id in the form of a mail address, like "kjetil.homme at redpill-linpro.com", although I find that a little icky myself (probably not rational). You can even include the full name of the person, like Kjetil Torgrim Homme (work) but it must match what is in the key exactly (including the parenthesis), so it is a little fickle. My proposed patch is kept simple: it reads each line into two variables, which means the first variable contains the first word, and the second variable the rest of the word. If the second variable starts with a "#", it is ignored. Otherwise the complete line is used. This means I am not allowed to add comments to the fingerprint version or the full id version, but I think the simplicity of the patch makes it worth it to not support that variant. (I don't know how to make Thunderbird/Enigmail not add linebreaks, so I attach the patch as a file in addition to the inline copy below.) diff --git src/password-store.sh src/password-store.sh index 7264ffc..b17ec58 100755 --- src/password-store.sh +++ src/password-store.sh @@ -98,7 +98,11 @@ set_gpg_recipients() { verify_file "$current" local gpg_id - while read -r gpg_id; do + while read -r gpg_id additional_columns; do + case $additional_columns in + ""|"# "*) : ;; # only keep first column, strip comment + *) gpg_id="${gpg_id} ${additional_columns}" ;; + esac GPG_RECIPIENT_ARGS+=( "-r" "$gpg_id" ) GPG_RECIPIENTS+=( "$gpg_id" ) done < "$current" -- Kjetil T. Homme Redpill Linpro - Changing the game -------------- next part -------------- A non-text attachment was scrubbed... Name: comments-in-gpg-id.patch Type: text/x-patch Size: 545 bytes Desc: not available URL: From quoiceehoh-20180826 at yxejamir.net Wed Dec 18 10:39:37 2019 From: quoiceehoh-20180826 at yxejamir.net (Amir Yalon) Date: Wed, 18 Dec 2019 11:39:37 +0200 Subject: [PATCH] Allow comments in .gpg-id In-Reply-To: References: Message-ID: <33af2c47-e990-42ee-8c28-43e7b31c69d9@www.fastmail.com> On Tue, Dec 17, 2019, at 18:55, Kjetil Torgrim Homme wrote: > - while read -r gpg_id; do > + while read -r gpg_id additional_columns; do > + case $additional_columns in > + ""|"# "*) : ;; # only keep first column, strip comment > + *) gpg_id="${gpg_id} ${additional_columns}" ;; > + esac It may be simpler to do gpg_id="${gpg_id%%#*}" instead. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rune at juhljacobsen.dk Wed Dec 18 11:35:10 2019 From: rune at juhljacobsen.dk (Rune Juhl Jacobsen) Date: Wed, 18 Dec 2019 11:35:10 +0100 Subject: [PATCH] Allow comments in .gpg-id In-Reply-To: <33af2c47-e990-42ee-8c28-43e7b31c69d9@www.fastmail.com> References: <33af2c47-e990-42ee-8c28-43e7b31c69d9@www.fastmail.com> Message-ID: <87o8w5hqg1.fsf@juhljacobsen.dk> I would probably reach for grep and do something like this instead: diff --git a/src/password-store.sh b/src/password-store.sh index 77f3eda..ce3f7fb 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -99,7 +99,7 @@ set_gpg_recipients() { verify_file "$current" local gpg_id - while read -r gpg_id; do + grep -Eo '^[^#]+' | grep -Ev '^\s*$' | while read -r gpg_id; do GPG_RECIPIENT_ARGS+=( "-r" "$gpg_id" ) GPG_RECIPIENTS+=( "$gpg_id" ) done < "$current" This will remove comments no matter if they're full lines or not, and will remove any lines containing only whitespace as well. I'm not sure about using `grep -E` though. It's more portable than `grep -e` or `egrep`, but I'm not sure if it'd be better to use `grep -P`, or if it's better to simply loop over all lines and use Bash regexes and BASH_REMATCH to remove comments and empty lines. /Rune "Amir Yalon" writes: > On Tue, Dec 17, 2019, at 18:55, Kjetil Torgrim Homme wrote: >> - while read -r gpg_id; do + while read -r gpg_id >> additional_columns; do + case $additional_columns in + ""|"# >> "*) : ;; # only keep first column, strip comment + *) >> gpg_id="${gpg_id} ${additional_columns}" ;; + esac > It may be simpler to do gpg_id="${gpg_id%%#*}" instead. > _______________________________________________ Password-Store > mailing list Password-Store at lists.zx2c4.com > https://lists.zx2c4.com/mailman/listinfo/password-store -- Rune Juhl Jacobsen rune at juhljacobsen.dk +45 6016 8337 From rune at juhljacobsen.dk Wed Dec 18 11:39:45 2019 From: rune at juhljacobsen.dk (Rune Juhl Jacobsen) Date: Wed, 18 Dec 2019 11:39:45 +0100 Subject: [PATCH] Allow comments in .gpg-id In-Reply-To: <87o8w5hqg1.fsf@juhljacobsen.dk> References: <33af2c47-e990-42ee-8c28-43e7b31c69d9@www.fastmail.com> <87o8w5hqg1.fsf@juhljacobsen.dk> Message-ID: <87immdhq8e.fsf@juhljacobsen.dk> Ouch, it seems like my editor ate a newline in the diff; sorry. Hopefully this works better... -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/x-diff Size: 424 bytes Desc: not available URL: -------------- next part -------------- /Rune "Rune Juhl Jacobsen" writes: > I would probably reach for grep and do something like this > instead: > > diff --git a/src/password-store.sh b/src/password-store.sh index > 77f3eda..ce3f7fb 100755 --- a/src/password-store.sh +++ > b/src/password-store.sh @@ -99,7 +99,7 @@ set_gpg_recipients() { > verify_file "$current" > > local gpg_id > - while read -r gpg_id; do + grep -Eo '^[^#]+' | grep -Ev > '^\s*$' | while read -r gpg_id; do > GPG_RECIPIENT_ARGS+=( "-r" "$gpg_id" ) GPG_RECIPIENTS+=( > "$gpg_id" ) > done < "$current" > > This will remove comments no matter if they're full lines or > not, and will remove any lines containing only whitespace as > well. > > I'm not sure about using `grep -E` though. It's more portable > than `grep -e` or `egrep`, but I'm not sure if it'd be better > to use `grep -P`, or if it's better to simply loop over all > lines and use Bash regexes and BASH_REMATCH to remove comments > and empty lines. > > /Rune > > "Amir Yalon" writes: > >> On Tue, Dec 17, 2019, at 18:55, Kjetil Torgrim Homme wrote: >>> - while read -r gpg_id; do + while read -r gpg_id >>> additional_columns; do + case $additional_columns in + ""|"# >>> "*) : ;; # only keep first column, strip comment + *) >>> gpg_id="${gpg_id} ${additional_columns}" ;; + esac >> It may be simpler to do gpg_id="${gpg_id%%#*}" instead. >> _______________________________________________ Password-Store >> mailing list Password-Store at lists.zx2c4.com >> https://lists.zx2c4.com/mailman/listinfo/password-store > > -- Rune Juhl Jacobsen rune at juhljacobsen.dk +45 6016 8337 -- Rune Juhl Jacobsen rune at juhljacobsen.dk +45 6016 8337 From kjetil.homme at redpill-linpro.com Wed Dec 18 12:16:56 2019 From: kjetil.homme at redpill-linpro.com (Kjetil Torgrim Homme) Date: Wed, 18 Dec 2019 12:16:56 +0100 Subject: [PATCH] Allow comments in .gpg-id In-Reply-To: <87immdhq8e.fsf@juhljacobsen.dk> References: <33af2c47-e990-42ee-8c28-43e7b31c69d9@www.fastmail.com> <87o8w5hqg1.fsf@juhljacobsen.dk> <87immdhq8e.fsf@juhljacobsen.dk> Message-ID: <1c4615ae-28bd-4c31-d305-dead83e5c666@redpill-linpro.com> On 18/12/2019 11.39, Rune Juhl Jacobsen wrote: > Ouch, it seems like my editor ate a newline in the diff; sorry. > Hopefully this works better... > > > diff --git a/src/password-store.sh b/src/password-store.sh > index 77f3eda..ce3f7fb 100755 > --- a/src/password-store.sh > +++ b/src/password-store.sh > @@ -99,7 +99,7 @@ set_gpg_recipients() { > verify_file "$current" > > local gpg_id > - while read -r gpg_id; do > + grep -Eo '^[^#]+' | grep -Ev '^\s*$' | while read -r gpg_id; do > GPG_RECIPIENT_ARGS+=( "-r" "$gpg_id" ) > GPG_RECIPIENTS+=( "$gpg_id" ) > done < "$current" grep -o is very useful, but not portable (not in POSIX). https://pubs.opengroup.org/onlinepubs/009695399/utilities/grep.html >> "Amir Yalon" writes: >>> It may be simpler to do gpg_id="${gpg_id%%#*}" instead. indeed, that is much simpler and more sensible! why didn't I think of that :-) --- src/password-store.sh +++ src/password-store.sh @@ -99,6 +99,7 @@ set_gpg_recipients() { local gpg_id while read -r gpg_id; do + gpg_id="${gpg_id%%#*}" # strip comment GPG_RECIPIENT_ARGS+=( "-r" "$gpg_id" ) GPG_RECIPIENTS+=( "$gpg_id" ) done < "$current" -- Kjetil T. Homme Redpill Linpro - Changing the Game From joel.voyer at gmail.com Wed Dec 18 16:29:47 2019 From: joel.voyer at gmail.com (Jo -l) Date: Wed, 18 Dec 2019 16:29:47 +0100 Subject: Password-Store Digest, Vol 79, Issue 3 In-Reply-To: References: Message-ID: > Le 18 12 2019 ? 12:00, password-store-request at lists.zx2c4.com a ?crit : > > Send Password-Store mailing list submissions to > password-store at lists.zx2c4.com > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.zx2c4.com/mailman/listinfo/password-store > or, via email, send a message with subject or body 'help' to > password-store-request at lists.zx2c4.com > > You can reach the person managing the list at > password-store-owner at lists.zx2c4.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Password-Store digest..." > > > Today's Topics: > > 1. [PATCH] Allow comments in .gpg-id (Kjetil Torgrim Homme) > 2. Re: [PATCH] Allow comments in .gpg-id (Amir Yalon) > 3. Re: [PATCH] Allow comments in .gpg-id (Rune Juhl Jacobsen) > 4. Re: [PATCH] Allow comments in .gpg-id (Rune Juhl Jacobsen) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 17 Dec 2019 17:55:58 +0100 > From: Kjetil Torgrim Homme > To: password-store at lists.zx2c4.com > Subject: [PATCH] Allow comments in .gpg-id > Message-ID: > Content-Type: text/plain; charset="utf-8" > > We are using password-store to share secrets within our organisation, so > there are dozens of entries in our .gpg-id files. A list of anonymous > 64-bit values is hard to work with (e.g., when a colleague leaves or a > new one arrives), so I would like to allow an optional comment to each line. > > The current logic allows space separated fingerprints like > > 8239 26C1 119D DD65 CC49 4A44 7708 DF87 BE42 C343 > > so we must continue to support spaces in the values. > > It is also allowed to use a user-id in the form of a mail address, like > "kjetil.homme at redpill-linpro.com", although I find that a little icky > myself (probably not rational). You can even include the full name of > the person, like > > Kjetil Torgrim Homme (work) > > but it must match what is in the key exactly (including the > parenthesis), so it is a little fickle. > > My proposed patch is kept simple: it reads each line into two variables, > which means the first variable contains the first word, and the second > variable the rest of the word. If the second variable starts with a > "#", it is ignored. Otherwise the complete line is used. This means I > am not allowed to add comments to the fingerprint version or the full id > version, but I think the simplicity of the patch makes it worth it to > not support that variant. > > (I don't know how to make Thunderbird/Enigmail not add linebreaks, so I > attach the patch as a file in addition to the inline copy below.) > > diff --git src/password-store.sh src/password-store.sh > index 7264ffc..b17ec58 100755 > --- src/password-store.sh > +++ src/password-store.sh > @@ -98,7 +98,11 @@ set_gpg_recipients() { > verify_file "$current" > > local gpg_id > - while read -r gpg_id; do > + while read -r gpg_id additional_columns; do > + case $additional_columns in > + ""|"# "*) : ;; # only keep first column, strip comment > + *) gpg_id="${gpg_id} ${additional_columns}" ;; > + esac > GPG_RECIPIENT_ARGS+=( "-r" "$gpg_id" ) > GPG_RECIPIENTS+=( "$gpg_id" ) > done < "$current" > > > -- > Kjetil T. Homme > Redpill Linpro - Changing the game > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: comments-in-gpg-id.patch > Type: text/x-patch > Size: 545 bytes > Desc: not available > URL: > > ------------------------------ > > Message: 2 > Date: Wed, 18 Dec 2019 11:39:37 +0200 > From: "Amir Yalon" > To: password-store at lists.zx2c4.com > Subject: Re: [PATCH] Allow comments in .gpg-id > Message-ID: <33af2c47-e990-42ee-8c28-43e7b31c69d9 at www.fastmail.com> > Content-Type: text/plain; charset="us-ascii" > > On Tue, Dec 17, 2019, at 18:55, Kjetil Torgrim Homme wrote: >> - while read -r gpg_id; do >> + while read -r gpg_id additional_columns; do >> + case $additional_columns in >> + ""|"# "*) : ;; # only keep first column, strip comment >> + *) gpg_id="${gpg_id} ${additional_columns}" ;; >> + esac > It may be simpler to do gpg_id="${gpg_id%%#*}" instead. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Wed, 18 Dec 2019 11:35:10 +0100 > From: "Rune Juhl Jacobsen" > To: password-store at lists.zx2c4.com > Subject: Re: [PATCH] Allow comments in .gpg-id > Message-ID: <87o8w5hqg1.fsf at juhljacobsen.dk> > Content-Type: text/plain; format=flowed > > I would probably reach for grep and do something like this > instead: > > diff --git a/src/password-store.sh b/src/password-store.sh index > 77f3eda..ce3f7fb 100755 --- a/src/password-store.sh +++ > b/src/password-store.sh @@ -99,7 +99,7 @@ set_gpg_recipients() { > verify_file "$current" > > local gpg_id > - while read -r gpg_id; do + grep -Eo '^[^#]+' | grep -Ev > '^\s*$' | while read -r gpg_id; do > GPG_RECIPIENT_ARGS+=( "-r" "$gpg_id" ) GPG_RECIPIENTS+=( > "$gpg_id" ) > done < "$current" > > > This will remove comments no matter if they're full lines or not, > and will remove any lines containing only whitespace as well. > > I'm not sure about using `grep -E` though. It's more portable than > `grep -e` or `egrep`, but I'm not sure if it'd be better to use > `grep -P`, or if it's better to simply loop over all lines and use > Bash regexes and BASH_REMATCH to remove comments and empty lines. > > /Rune > > "Amir Yalon" writes: > >> On Tue, Dec 17, 2019, at 18:55, Kjetil Torgrim Homme wrote: >>> - while read -r gpg_id; do + while read -r gpg_id >>> additional_columns; do + case $additional_columns in + ""|"# >>> "*) : ;; # only keep first column, strip comment + *) >>> gpg_id="${gpg_id} ${additional_columns}" ;; + esac >> It may be simpler to do gpg_id="${gpg_id%%#*}" instead. >> _______________________________________________ Password-Store >> mailing list Password-Store at lists.zx2c4.com >> https://lists.zx2c4.com/mailman/listinfo/password-store > > -- > Rune Juhl Jacobsen > rune at juhljacobsen.dk > +45 6016 8337 > > > ------------------------------ > > Message: 4 > Date: Wed, 18 Dec 2019 11:39:45 +0100 > From: "Rune Juhl Jacobsen" > To: password-store at lists.zx2c4.com > Subject: Re: [PATCH] Allow comments in .gpg-id > Message-ID: <87immdhq8e.fsf at juhljacobsen.dk> > Content-Type: text/plain; charset="us-ascii"; Format="flowed" > > Ouch, it seems like my editor ate a newline in the diff; sorry. > Hopefully this works better... > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: not available > Type: text/x-diff > Size: 424 bytes > Desc: not available > URL: > -------------- next part -------------- > > /Rune > > "Rune Juhl Jacobsen" writes: > >> I would probably reach for grep and do something like this >> instead: >> >> diff --git a/src/password-store.sh b/src/password-store.sh index >> 77f3eda..ce3f7fb 100755 --- a/src/password-store.sh +++ >> b/src/password-store.sh @@ -99,7 +99,7 @@ set_gpg_recipients() { >> verify_file "$current" >> >> local gpg_id >> - while read -r gpg_id; do + grep -Eo '^[^#]+' | grep -Ev >> '^\s*$' | while read -r gpg_id; do >> GPG_RECIPIENT_ARGS+=( "-r" "$gpg_id" ) GPG_RECIPIENTS+=( >> "$gpg_id" ) >> done < "$current" >> >> This will remove comments no matter if they're full lines or >> not, and will remove any lines containing only whitespace as >> well. >> >> I'm not sure about using `grep -E` though. It's more portable >> than `grep -e` or `egrep`, but I'm not sure if it'd be better >> to use `grep -P`, or if it's better to simply loop over all >> lines and use Bash regexes and BASH_REMATCH to remove comments >> and empty lines. >> >> /Rune >> >> "Amir Yalon" writes: >> >>> On Tue, Dec 17, 2019, at 18:55, Kjetil Torgrim Homme wrote: >>>> - while read -r gpg_id; do + while read -r gpg_id >>>> additional_columns; do + case $additional_columns in + ""|"# >>>> "*) : ;; # only keep first column, strip comment + *) >>>> gpg_id="${gpg_id} ${additional_columns}" ;; + esac >>> It may be simpler to do gpg_id="${gpg_id%%#*}" instead. >>> _______________________________________________ Password-Store >>> mailing list Password-Store at lists.zx2c4.com >>> https://lists.zx2c4.com/mailman/listinfo/password-store >> >> -- Rune Juhl Jacobsen rune at juhljacobsen.dk +45 6016 8337 > > -- > Rune Juhl Jacobsen > rune at juhljacobsen.dk > +45 6016 8337 > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > Password-Store mailing list > Password-Store at lists.zx2c4.com > https://lists.zx2c4.com/mailman/listinfo/password-store > > > ------------------------------ > > End of Password-Store Digest, Vol 79, Issue 3 > ********************************************* From graham at grahamc.com Fri Dec 20 04:07:19 2019 From: graham at grahamc.com (Graham Christensen) Date: Thu, 19 Dec 2019 22:07:19 -0500 Subject: [PATCH] clip(): support single-binary coreutils Message-ID: I don't quite grok the patch, however it has been part of the Nixpkgs tree since 2016: https://github.com/NixOS/nixpkgs/blob/c0628397e14f6ad4307cfa8a34738af88833e51f/pkgs/tools/security/pass/set-correct-program-name-for-sleep.patch Sending it upstream to a public review, and in case it is useful for other distributions who also use a single-binary coreutils. --- src/password-store.sh | 4 ++-- src/platform/cygwin.sh | 4 ++-- src/platform/darwin.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/password-store.sh b/src/password-store.sh index 77f3eda..76bbecc 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -173,11 +173,11 @@ clip() { # This base64 business is because bash cannot store binary data in a shell # variable. Specifically, it cannot store nulls nor (non-trivally) store # trailing new lines. - pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 + pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5 local before="$("${paste_cmd[@]}" 2>/dev/null | $BASE64)" echo -n "$1" | "${copy_cmd[@]}" || die "Error: Could not copy data to the clipboard" ( - ( exec -a "$sleep_argv0" bash <<<"trap 'kill %1' TERM; sleep '$CLIP_TIME' & wait" ) + ( exec -a "$sleep_argv0" bash <(echo trap 'kill %1' TERM\; sleep "$CLIP_TIME & wait") ) local now="$("${paste_cmd[@]}" | $BASE64)" [[ $now != $(echo -n "$1" | $BASE64) ]] && before="$now" diff --git a/src/platform/cygwin.sh b/src/platform/cygwin.sh index 5a8d5ea..423e0ce 100644 --- a/src/platform/cygwin.sh +++ b/src/platform/cygwin.sh @@ -3,11 +3,11 @@ clip() { local sleep_argv0="password store sleep on display $DISPLAY" - pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 + pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5 local before="$($BASE64 < /dev/clipboard)" echo -n "$1" > /dev/clipboard ( - ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" ) + ( exec -a "$sleep_argv0" bash <(echo sleep "$CLIP_TIME") ) local now="$($BASE64 < /dev/clipboard)" [[ $now != $(echo -n "$1" | $BASE64) ]] && before="$now" echo "$before" | $BASE64 -d > /dev/clipboard diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh index 342ecce..9e12837 100644 --- a/src/platform/darwin.sh +++ b/src/platform/darwin.sh @@ -3,11 +3,11 @@ clip() { local sleep_argv0="password store sleep for user $(id -u)" - pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 + pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5 local before="$(pbpaste | $BASE64)" echo -n "$1" | pbcopy ( - ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" ) + ( exec -a "$sleep_argv0" bash <(echo sleep "$CLIP_TIME") ) local now="$(pbpaste | $BASE64)" [[ $now != $(echo -n "$1" | $BASE64) ]] && before="$now" echo "$before" | $BASE64 -d | pbcopy -- 2.23.1 From alexander.kjall at gmail.com Fri Dec 20 21:35:52 2019 From: alexander.kjall at gmail.com (=?UTF-8?Q?Alexander_Kj=C3=A4ll?=) Date: Fri, 20 Dec 2019 21:35:52 +0100 Subject: Replace link to gopass on website with ripasso Message-ID: Hi Under the `Compatible Clients` section on the webpage there is a link to gopass ( https://github.com/cortex/gopass#readme ). The gopass project has been terminated, and we have done a rewrite of the client in rust here: https://github.com/cortex/ripasso . The new project is named ripasso. Would it be possible to update the compatible clients section to reflect this? best regards Alexander Kj?ll