Page MenuHome GnuPG

"gpgconf --list-options gpg-agent" fails if bad option is present in ~/.gnupg/gpg-agent.conf
Open, NormalPublic

Description

try this:

GNUPGHOME=$(mktemp -d)
gpgconf --list-options gpg-agent
echo no-such-option > "$GNUPGHOME/gpg-agent.conf"
gpgconf --list-options gpg-agent

the second gpgconf invocation returns a non-zero error code, prints nothing to stdout, and the following two lines to stderr:

gpgconf: running /usr/bin/gpg-agent failed (exitcode=2): General error
gpgconf: fatal error (exit status 1)

This makes it pretty problematic to use gpgconf --list-options in initialization scripts (whether at a system level or at a user level) if there's a risk of a bad option being present.

Details

Version
2.2.0

Event Timeline

dkg created this object in space S1 Public.

The only mitigation I can see for this is a better error message.

werner triaged this task as Normal priority.Sep 12 2017, 9:30 AM
werner added a project: Documentation.