zero length names on SunOS
SCCS-vsn: usr.sbin/sendmail/src/domain.c 6.10
SCCS-vsn: usr.sbin/sendmail/src/version.c 6.35
SCCS-vsn: usr.sbin/sendmail/src/daemon.c 6.14
#ifndef lint
#ifdef DAEMON
#ifndef lint
#ifdef DAEMON
-static char sccsid[] = "@(#)daemon.c 6.13 (Berkeley) %G% (with daemon mode)";
+static char sccsid[] = "@(#)daemon.c 6.14 (Berkeley) %G% (with daemon mode)";
-static char sccsid[] = "@(#)daemon.c 6.13 (Berkeley) %G% (without daemon mode)";
+static char sccsid[] = "@(#)daemon.c 6.14 (Berkeley) %G% (without daemon mode)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
extern struct hostent *gethostbyaddr();
extern char *inet_ntoa();
extern struct hostent *gethostbyaddr();
extern char *inet_ntoa();
- if (getsockname(fd, (struct sockaddr *) &sin, &sinlen) < 0)
+ if (getsockname(fd, (struct sockaddr *) &sin, &sinlen) < 0 ||
+ sinlen <= 0)
return NULL;
hp = gethostbyaddr((char *) &sin.sin_addr, sizeof sin.sin_addr,
sin.sin_family);
return NULL;
hp = gethostbyaddr((char *) &sin.sin_addr, sizeof sin.sin_addr,
sin.sin_family);
#ifndef lint
#ifdef NAMED_BIND
#ifndef lint
#ifdef NAMED_BIND
-static char sccsid[] = "@(#)domain.c 6.9 (Berkeley) %G% (with name server)";
+static char sccsid[] = "@(#)domain.c 6.10 (Berkeley) %G% (with name server)";
-static char sccsid[] = "@(#)domain.c 6.9 (Berkeley) %G% (without name server)";
+static char sccsid[] = "@(#)domain.c 6.10 (Berkeley) %G% (without name server)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
- if (h_errno == HOST_NOT_FOUND)
+ if (h_errno != HOST_NOT_FOUND)
- /* definitely no data for this address */
- dp++;
- qtype = T_ANY; /* just in case */
- continue;
+ /* might have another type of interest */
+ if (qtype == T_ANY)
+ {
+ qtype = T_A;
+ continue;
+ }
+ else if (qtype == T_A && !gotmx)
+ {
+ qtype = T_MX;
+ continue;
+ }
/* we matched before -- use that one */
break;
}
/* we matched before -- use that one */
break;
}
+
+ /* otherwise, try the next name */
+ dp++;
+ qtype = T_ANY;
continue;
}
else if (tTd(8, 8))
continue;
}
else if (tTd(8, 8))
-static char sccsid[] = "@(#)version.c 6.34 (Berkeley) %G%";
+static char sccsid[] = "@(#)version.c 6.35 (Berkeley) %G%";
-char Version[] = "ALPHA-6.34";
+char Version[] = "ALPHA-6.35";