You are not logged in.

#1 2014-08-07 12:27:29

gauthma
Member
Registered: 2010-02-16
Posts: 222
Website

Mutt, gpg-agent (env var)... and the worst wiki typo ever?

So a couple of years ago I had some problems with mutt and gpg-agent, which were now properly solved.

Until a couple of weeks ago, I decided to change the way I started gpg-agent: I used the gpg-agent.sh script described in the fine wiki, but changed to using the alternative solution which is to dump eval $(gpg-agent --daemon) & in my .xinitrc (ibid.) -- because it's much simpler and I don't need gpg-agent system wide.

This however, caused mutt to always ask the passphrase twice! To cut a long story short, mutt tries to determine whether an agent is running, and if it is not, it asks for the passphrase itself (in the console, much like pineentry-curses). Now I had checked that pgp-agent was running ($ pgrep gpg-agent returns its PID) but much to my amasement, mutt continued to ask for the passphrase itself! At which point I just pressed Enter without writing anything, and then, pineentry asked for the pass, and from here on everything worked as normal.

So I delved into mutt's source, and it turns out (pgp.c) that the way mutt checks whether gpg-agent is running or not is to check for the GPG_AGENT_INFO variable... which the above line in .xinitrc does NOT export!!

And why is that the case? Well, wait for it, because of the final &!!! Indeed if you just put eval $(gpg-agent --daemon) (note the final & is gone) into .xinitrc, everything works flawlessly.

So before correcting that typo myself I wanted to check if, although I doubt it, is there any reason at all for that trailing &?

Offline

#2 2014-08-07 15:17:12

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: Mutt, gpg-agent (env var)... and the worst wiki typo ever?

You don't need this envvar hack anymore. Starting from recently gpg is compiled with use-standard-socket option enabled by default. It means if GPG_AGENT_INFO is not specified then it will look for the agent socket in ~/.gnupg/ folder.


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

#3 2014-08-07 15:31:55

gauthma
Member
Registered: 2010-02-16
Posts: 222
Website

Re: Mutt, gpg-agent (env var)... and the worst wiki typo ever?

anatolik wrote:

You don't need this envvar hack anymore. Starting from recently gpg is compiled with use-standard-socket option enabled by default. It means if GPG_AGENT_INFO is not specified then it will look for the agent socket in ~/.gnupg/ folder.

Well gnupg might not needed it anymore, but mutt does... In any case, that does not explain why should the gpg-agent need to be started both as a daemon and in the background.

Last edited by gauthma (2014-08-07 15:32:55)

Offline

Board footer

Powered by FluxBB