Page MenuHome GnuPG

"gpgconf --launch dirmngr" fails but does not return non-zero error code
Closed, ResolvedPublic

Description

i'd expect "gpgconf --launch dirmngr" to return a non-zero error code if
it failed to ensure that the dirmngr was launched.

however, if there's something wrong in dirmngr.conf that prevents a
launch, it still returns a 0 error code:

0 test@simple:~$ pidof dirmngr
1 test@simple:~$ gpgconf --launch dirmngr
gpgconf: error running '/usr/bin/gpg-connect-agent': exit status 1
gpgconf: error running '/usr/bin/gpg-connect-agent --dirmngr NOP': General error
0 test@simple:~$ dirmngr --version
dirmngr[7089.0]: /home/test/.gnupg/dirmngr.conf:3: invalid option
dirmngr (GnuPG) 2.1.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
0 test@simple:~$ gpgconf --version
gpgconf (GnuPG) 2.1.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
0 test@simple:~$

Details

Version
2.1.1

Event Timeline

dkg added projects: dirmngr, Bug Report.
dkg added a subscriber: dkg.
werner added a subscriber: werner.

Okay, fixed with commit 5cb6df8.

dkg claimed this task.
dkg removed a project: Restricted Project.

I can confirm that this is resolved in 2.1.3:

0 dkg@alice:~$ gpgconf --launch dirmngr
gpgconf: error running '/usr/bin/gpg-connect-agent': exit status 1
gpgconf: error running '/usr/bin/gpg-connect-agent --dirmngr NOP': General error
1 dkg@alice:~$

the error message isn't particularly helpful at directing the user to the source
of the problem (a bad dirmngr.conf), but at least it does return a non-zero
error code.