Hi,

On 2014-09-02 23:03:50 +0200, Joachim Breitner wrote:
> Am Dienstag, den 02.09.2014, 18:33 +0200 schrieb Vincent Lefevre:
> > I had "files" first in "hosts:" (I suppose that this corresponds
> > to /etc/hosts), and still first after libnss-myhostname got
> > installed. This means that libnss-myhostname overrode it. But
> > I'll try to look what is done with strace.
> 
> not sure what you mean. libnss-myhostname currently installs itself
> always directly after files.

I meant that I have

  hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

without libnss-myhostname, and

  hosts:          files myhostname mdns4_minimal [NOTFOUND=return] dns mdns4

with libnss-myhostname. In both cases, "files" has the precedence
over everything else, and the FQDN can be obtained from /etc/hosts,
so that it is strange that libnss-myhostname changes the behavior.
See below for the explanation.

> > What does "Existing installations are not modified." mean? I ask this
> > because /etc/nsswitch.conf got modified.
> 
> Existing installations of libnss-myhostname, i.e. if it is already
> present in /etc/nsswitch.conf.

What if libnss-myhostname is installed but the user has removed
"myhostname" from /etc/nsswitch.conf?

> If you move it to the end of the line there, does it work better for
> you?

No, same problem with:

  hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4 myhostname

With "strace -o strace.out exim4 -bP", I can see that /etc/hosts is
read, but I don't know whether this is meaningful.

Exim does the following: it first calls

  gethostbyname2(nodename, AF_INET6)

and if it returns NULL, it calls

  gethostbyname2(nodename, AF_INET)

When myhostname is not used, the first call (with AF_INET6) fails
(because in /etc/hosts, only IPv4 is set up as this is sufficient
locally), and the second call returns the FQDN ypig.lip.ens-lyon.fr.

When myhostname is used, the first call succeeds, but once just gets
ypig.

So, the problem seems to be that myhostname adds a host for IPv6,
overriding the IPv4 user's /etc/hosts setting when IPv6 is tried
first.

IMHO, before changing anything, libnss-myhostname should first detect
whether the nodename is resolvable with either IPv4 or IPv6 (checking
for IPv4 only should be sufficient in practice, but this might change
in a distant future once IPv4 has disappeared). If it is, then it
should not change anything.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to