writeconfig: emit error messages again in VerifyEntries

Before commit e4a8a7a38dbf29e89bc1a7b6b017447a6aa0c764 an error message
was printed if looking up a server hostname failed. Restore this, and
also print a message in the now detected case that the lookup returns
loopback addresses only.

Change-Id: Idf7c3133ab5c83e081335ba1dc8fcbddb7da7329
Reviewed-on: http://gerrit.openafs.org/12097
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
Stephan Wiesand 2015-11-17 15:03:03 +01:00 committed by Benjamin Kaduk
parent 33020f573b
commit f6247f90c9

View File

@ -45,6 +45,8 @@ VerifyEntries(struct afsconf_cell *aci)
code = getaddrinfo(aci->hostName[i], NULL, &hints, &result);
if (code) {
printf("Host %s not found in host database...\n",
aci->hostName[i]);
return AFSCONF_FAILURE;
}
for (rp = result; rp != NULL; rp = rp->ai_next) {
@ -56,6 +58,8 @@ VerifyEntries(struct afsconf_cell *aci)
}
freeaddrinfo(result);
if (aci->hostAddr[i].sin_addr.s_addr == 0) {
printf("No non-loopback addresses found for host %s\n",
aci->hostName[i]);
return AFSCONF_FAILURE;
}
}