[pass] pass grep doesn't spawn pinentry dialog when no cached password is available in gpg-agent

Allan Odgaard lists+pass at simplit.com
Wed Nov 26 05:21:35 CET 2014


On 26 Nov 2014, at 8:13, nfb wrote:

> […] I'm using pass on Debian jessie/testing […] no cached password 
> […] What i get is:
> […] which i have to brutally stop like this since it seems to go on 
> forever.

There is a similar problem on OS X, here though no output is shown, 
instead a background task takes 100% CPU time.

> My question is: is there a reason why the grep command doesn't spawn 
> the
> pinentry dialog like […]

I believe the problem is with the invocation:

	grepresults="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | grep 
--color=always "$search")"

Here the output of $GPG is sent to a pipe, so there is no tty for 
bringing up the passphrase dialog.

That it goes into an infinite loop I think is an issue with $GPG but 
pass should probably do the above different so that $GPG is called with 
a tty available, the easiest is probably to do some dummy encryption 
action with $GPG before the loop, so that the passphrase gets added to 
gpg-agent (should it not already be cached). It does seem a little 
redundant though, and the user could fail to provide the correct 
passphrase for the dummy encryption task, so that grep would still fail 
in this unpleasent way.


More information about the Password-Store mailing list