writeconfig: emit error messages again in VerifyEntries
authorStephan Wiesand <stephan.wiesand@desy.de>
Tue, 17 Nov 2015 14:03:03 +0000 (15:03 +0100)
committerBenjamin Kaduk <kaduk@mit.edu>
Wed, 18 Nov 2015 15:43:56 +0000 (10:43 -0500)
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>

src/auth/writeconfig.c

index 715d8a8..5655dba 100644 (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;
                }
            }