chiark / gitweb /
nss-myhostname: resolve 'localhost' so that /etc/hosts becomes optional
authorLennart Poettering <lennart@poettering.net>
Wed, 24 Apr 2013 20:18:01 +0000 (17:18 -0300)
committerLennart Poettering <lennart@poettering.net>
Wed, 24 Apr 2013 22:02:13 +0000 (19:02 -0300)
commite8a7a315391a6a07897122725cd707f4e9ce63d7
tree4fb99f88b8e3bdb47cdc846a27113ee9fe0a0be5
parent2b77f67e78827cc7e85fb43b05d3e1623b31a1bf
nss-myhostname: resolve 'localhost' so that /etc/hosts becomes optional

This makes sure nss-myhostname not only resolves the local host name to
127.0.0.2/::1 but also the host name 'localhost: to 127.0.0.1/::1. This
makes installation of /etc/passwd optional, as it usually only includes
a mapping for 'localhost'.

This change also resolves ::1 to the local hostname (as before), but
also lists 'localhost' as an alias. This means look-ups are now fully
reversible, even though they are 1:n mappings.

Finally, the module will no longer erroneously claim that local IP
addresses which aren't on the loopback device were.
TODO
src/nss-myhostname/nss-myhostname.c