pass doesn't exit 1 when encryption fails

Tycho Andersen tycho at docker.com
Thu Aug 17 01:21:07 CEST 2017


Hi all,

In some cases (e.g. when there is a pub key missing), gpg prints an error
to stderr, but pass doesn't seem to exit 1:

ubuntu at docker:~$ pass init 1024D/6AC43D77
mkdir: created directory '/home/ubuntu/.password-store/'
Password store initialized for 1024D/6AC43D77
ubuntu at docker:~$ pass insert -f -m foo/bar
mkdir: created directory '/home/ubuntu/.password-store/foo'
Enter contents of foo/bar and press Ctrl+D when finished:

gpg: 1024D/6AC43D77: skipped: No public key
gpg: [stdin]: encryption failed: No public key
ubuntu at docker:~$ echo $?
0
ubuntu at docker:~$ ls -al .password-store/foo/
total 8
drwx------ 2 ubuntu ubuntu 4096 Aug 16 23:14 .
drwx------ 3 ubuntu ubuntu 4096 Aug 16 23:14 ..

The foo directory is created, but the password is not inserted. It seems
that at least pass should exit 1 if it failed, but maybe also it should
delete foo, since there's nothing in that directory?

Cheers,

Tycho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20170816/71b926cb/attachment.html>


More information about the Password-Store mailing list