Page MenuHome GnuPG

gpgconf exits with error if dirmngr_ldapservers.conf doesn't exist
Closed, ResolvedPublic

Description

gpgconf --list-options dirmngr fails with an error and without printing any
options if ~/.gnupg/dirmngr_ldapservers.conf doesn't exist:

$ gpgconf --list-options dirmngr
dirmngr[31235]: error opening `/home/testuser/.gnupg/dirmngr_ldapservers.conf':
No such file or directory
gpgconf: warning: can not open config file /home/testuser/.gnupg/dirmngr.conf:
No such file or directory
gpgconf: warning: can not open list file
/home/testuser/.gnupg/dirmngr_ldapservers.conf: No such file or directory
Segmentation fault

This is gpgconf from gnupg 2.0.7 and dirmngr 1.0.1.

Details

Version
2.0.7

Event Timeline

bherzog set Version to 2.0.7.
bherzog added a subscriber: bherzog.

It used to work in earlier versions and this issue
now block rollout to production customers, thus a warrenty kks
and "urgent" because of the blocking effect.

bernhard raised the priority of this task from Normal to High.
bernhard added a project: kks.
bernhard added a subscriber: werner.

Fixed in SVN. I can't see a regression here, through.
Here is the short fix:

  • tools/gpgconf-comp.c (revision 4586)

+++ tools/gpgconf-comp.c (working copy)
@@ -1880,7 +1880,7 @@

list_option->active = 1;
list_option->value = list;
  • if (fclose (list_file) && ferror (list_file))

+ if (list_file && fclose (list_file) && ferror (list_file))

  gc_error (1, errno, "error closing %s", list_pathname);
xfree (line);

}

werner added a project: Restricted Project.
werner claimed this task.
werner removed a project: Restricted Project.