Diffusion GnuPG d4c0187dd931

libdns: Hack to skip negation term.

Authored by bisson on Jan 23 2017, 12:46 PM.


libdns: Hack to skip negation term.

* dirmngr/dns.c (dns_nssconf_loadfile): Skip negation terms in
nsswitch.conf parser.

This small patch was submitted along with this comment:

We've been having issues over at Arch Linux with the new libdns
code.  Our /etc/nsswitch.conf contains the following line:

  hosts: files mymachines resolve [!UNAVAIL=return] dns myhostname

And it turns out dirmngr fails to parse the negation statement (the
bang in !UNAVAIL). This results in gnupg not being able to resolve
any name.

Looking at dirmngr/dns.c it was unclear to me how to properly handle
such negations. The dns_anyconf_scan calls used in
dns_nssconf_loadfile do not allow to store a negation bit easily...

In the meantime, I wrote the attached patch which ignores those
statements altogether. It makes libdns work as expected for us.

Commit log written by wk


wernerJan 23 2017, 12:46 PM
rG9ae0b81e4ff0: dirmngr: Print debug message only with --debug.