Sources Bugzilla – Bug 11928
nscd does not account for 'multi on' in /etc/host.conf when ai-resolving hosts
Last modified: 2012-12-19 10:39:46 UTC
When nscd is handling getaddrinfo() resolution requests, it fails to properly initialize its resolver options state and ignores /etc/host.conf. An easy way to reproduce this is by putting 'multi on' in /etc/host.conf and cat >>/etc/host.conf <<EOT 1.2.3.4 test 1.2.3.5 test EOT Then, with nscd stopped: $ getent ahosts test 1.2.3.4 STREAM test 1.2.3.4 DGRAM 1.2.3.4 RAW 1.2.3.5 STREAM 1.2.3.5 DGRAM 1.2.3.5 RAW However, with nscd running: $ getent ahosts test 1.2.3.4 STREAM test 1.2.3.4 DGRAM 1.2.3.4 RAW
Created attachment 4940 [details] proposed patch This patch makes sure _res_hconf is initialized before resolving is being done. However, this would not be enough since nscd has its own _res_hconf due to nscd/res_hconf.c; _res_hconf_init() would work on different _res_hconf instance than the NSS routines. We just need to make sure nscd and glibc share the same _res_hconf instance - this should not be a problem since users should run matching versions of glibc and nscd anyway.
*** Bug 11536 has been marked as a duplicate of this bug. ***