avoid writing loopback addresses into CellServDB
authorMichael Meffie <mmeffie@sinenomine.net>
Tue, 4 Nov 2014 00:06:15 +0000 (19:06 -0500)
committerD Brashear <shadow@your-file-system.com>
Wed, 5 Nov 2014 13:23:03 +0000 (08:23 -0500)
commite4a8a7a38dbf29e89bc1a7b6b017447a6aa0c764
tree4c922de58e8296a5061e3fe970ecb725a544d4e2
parent9be7e23cc562a2dfec2dc4cd7614c5ca5f397789
avoid writing loopback addresses into CellServDB

Do not use loopback addresses for the server side CellServDB file.  Use
getaddrinfo() instead of gethostbyname() to look up a list of IPv4
addresses for a given hostname, and take the first non-loopback address.

This avoids writing a loopback address into the CellServDB on systems
such as Debian, which map the address 127.0.1.1 to the hostname in the
/etc/hosts file.

Change-Id: I11521df50262ca80c7db21b7b44671d94bef3587
Reviewed-on: http://gerrit.openafs.org/11585
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
src/auth/writeconfig.c