for NIS & /etc/hosts back compatibility
SCCS-vsn: usr.sbin/sendmail/src/daemon.c 8.39
#ifndef lint
#ifdef DAEMON
#ifndef lint
#ifdef DAEMON
-static char sccsid[] = "@(#)daemon.c 8.38 (Berkeley) %G% (with daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.39 (Berkeley) %G% (with daemon mode)";
-static char sccsid[] = "@(#)daemon.c 8.38 (Berkeley) %G% (without daemon mode)";
+static char sccsid[] = "@(#)daemon.c 8.39 (Berkeley) %G% (without daemon mode)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
{
/* try it as a host name (avoid MX lookup) */
hp = gethostbyname(&host[1]);
{
/* try it as a host name (avoid MX lookup) */
hp = gethostbyname(&host[1]);
+ if (hp == NULL && p[-1] == '.')
+ {
+ p[-1] = '\0';
+ hp = gethostbyname(&host[1]);
+ p[-1] = '.';
+ }
*p = ']';
goto gothostent;
}
*p = ']';
goto gothostent;
}
+ register char *p = &host[strlen(host) - 1];
+
hp = gethostbyname(host);
hp = gethostbyname(host);
+ if (hp == NULL && *p == '.')
+ {
+ *p = '\0';
+ hp = gethostbyname(host);
+ *p = '.';
+ }
gothostent:
if (hp == NULL)
{
gothostent:
if (hp == NULL)
{