how to improve tools that test for $GPG_AGENT_INFO

Damien Goutte-Gattat dgouttegattat at incenp.org
Wed Mar 18 20:11:05 CET 2015


On 03/18/2015 06:16 PM, Daniel Kahn Gillmor wrote:
> Some ideas of what they should do if they don't see GPG_AGENT_INFO in
> the environment:
>
>   * run "gpg-agent -q" -- if the return code is 0, then you should use
>     the agent.
>
>   * run "gpg --version" look at the output.  If you see 2.1.x or later,
>     then you should use the agent.

Another possibility (which still requires to spawn a new process) would 
be the --use-standard-socket-p option.

If "gpg-agent --use-standard-socket-p" returns 0, then you know you can 
use the agent even if there is no GPG_AGENT_INFO in the environment.

This should work with both GnuPG 2.0 and GnuPG 2.1.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: </pipermail/attachments/20150318/4e43df8a/attachment.sig>


More information about the Gnupg-devel mailing list