*/
#include "config.h"
#ifdef HAVE_GETHOSTBYNAME
+#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
+#include "i18n.h"
#include "mx.h"
#include "fetchmail.h"
/*
* Given two hostnames as arguments, returns TRUE if they
* have at least one IP address in common.
- * It is meant to be called by the is_host_alias() function in driver.c
* No check is done on errors returned by gethostbyname,
* the calling function does them.
*/
address_t address;
}
address_e;
- address_e *host_a_addr, *host_b_addr,*dummy_addr;
+ address_e *host_a_addr=0, *host_b_addr=0; /* assignments pacify -Wall */
+ address_e *dummy_addr;
int i;
struct hostent *hp;
{
struct in_addr in;
(void) memcpy(&in.s_addr, *p, sizeof (in.s_addr));
- host_a_addr = (address_e *)xmalloc(sizeof( address_e));
+ xalloca(host_a_addr, address_e *, sizeof (address_e));
memset (host_a_addr,0, sizeof (address_e));
host_a_addr->next = dummy_addr;
(void) memcpy(&host_a_addr->address, *p, sizeof (in.s_addr));
{
struct in_addr in;
(void) memcpy(&in.s_addr, *p, sizeof (in.s_addr));
- host_b_addr = (address_e *)xmalloc(sizeof( address_e));
+ xalloca(host_b_addr, address_e *, sizeof (address_e));
memset (host_b_addr,0, sizeof (address_e));
host_b_addr->next = dummy_addr;
(void) memcpy(&host_b_addr->address, *p, sizeof (in.s_addr));
}
int is_host_alias(const char *name, struct query *ctl)
-/* determine whether name is a DNS alias of the hostname */
+/* determine whether name is a DNS alias of the mailserver for this query */
{
struct hostent *he,*he_st;
struct mxentry *mxp, *mxrecords;
#else
/*
* The only code that calls the BIND library is here and in the
- * start-of-query probe with gethostbyname(3).
+ * start-of-run probe with gethostbyname(3) under ETRN/Kerberos.
*
- * We know DNS service was up at the beginning of this poll cycle.
+ * We know DNS service was up at the beginning of the run.
* If it's down, our nameserver has crashed. We don't want to try
- * delivering the current message or anything else from this
- * mailbox until it's back up.
+ * delivering the current message or anything else from the
+ * current server until it's back up.
*/
else if ((he = gethostbyname(name)) != (struct hostent *)NULL)
{
goto match;
else if (((he_st = gethostbyname(ctl->server.truename)) != (struct hostent *)NULL) && ctl->server.checkalias)
{
- if (outlevel == O_VERBOSE)
- error(0, 0, "Checking if %s is really the same node as %s",ctl->server.truename,name);
+ if (outlevel >= O_DEBUG)
+ report(stdout, _("Checking if %s is really the same node as %s\n"),ctl->server.truename,name);
if (is_ip_alias(ctl->server.truename,name) == TRUE)
{
- if (outlevel == O_VERBOSE)
- error(0, 0, "Yes, their IP addresses match");
+ if (outlevel >= O_DEBUG)
+ report(stdout, _("Yes, their IP addresses match\n"));
goto match;
}
- if (outlevel == O_VERBOSE)
- error(0, 0, "No, their IP addresses don't match");
+ if (outlevel >= O_DEBUG)
+ report(stdout, _("No, their IP addresses don't match\n"));
}
else
return(FALSE);
case TRY_AGAIN: /* temporary error on authoritative server */
default:
if (outlevel != O_SILENT)
- putchar('\n'); /* terminate the progress message */
- error(0, 0,
- "nameserver failure while looking for `%s' during poll of %s.",
+ report_complete(stdout, "\n"); /* terminate the progress message */
+ report(stderr,
+ _("nameserver failure while looking for `%s' during poll of %s.\n"),
name, ctl->server.pollname);
ctl->errcount++;
break;
case NO_RECOVERY: /* non-recoverable name server error */
case TRY_AGAIN: /* temporary error on authoritative server */
default:
- error(0, -1,
- "nameserver failure while looking for `%s' during poll of %s.",
+ report(stderr,
+ _("nameserver failure while looking for `%s' during poll of %s.\n"),
name, ctl->server.pollname);
ctl->errcount++;
break;