Make hostname comparisons case insensitive

This commit is contained in:
Brian Somers 1999-08-17 01:25:16 +00:00
parent fb320ea83a
commit 2d3411d359
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=49940

View File

@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94";
#endif
static const char rcsid[] =
"$Id: syslogd.c,v 1.50 1999/05/04 18:03:59 des Exp $";
"$Id: syslogd.c,v 1.51 1999/05/06 13:57:57 dt Exp $";
#endif /* not lint */
/*
@ -745,7 +745,7 @@ logmsg(pri, msg, from, flags)
*/
if ((flags & MARK) == 0 && msglen == f->f_prevlen &&
!strcmp(msg, f->f_prevline) &&
!strcmp(from, f->f_prevhost)) {
!strcasecmp(from, f->f_prevhost)) {
(void)strncpy(f->f_lasttime, timestamp, 15);
f->f_prevcount++;
dprintf("msg repeated %d times, %ld sec of %d\n",
@ -889,7 +889,7 @@ fprintlog(f, flags, msg)
case F_FORW:
dprintf(" %s\n", f->f_un.f_forw.f_hname);
/* check for local vs remote messages */
if (strcmp(f->f_prevhost, LocalHostName))
if (strcasecmp(f->f_prevhost, LocalHostName))
l = snprintf(line, sizeof line - 1,
"<%d>%.15s Forwarded from %s: %s",
f->f_prevpri, iov[0].iov_base, f->f_prevhost,
@ -1115,7 +1115,8 @@ cvthname(f)
inet_ntoa(f->sin_addr));
return (inet_ntoa(f->sin_addr));
}
if ((p = strchr(hp->h_name, '.')) && strcmp(p + 1, LocalDomain) == 0)
if ((p = strchr(hp->h_name, '.')) &&
strcasecmp(p + 1, LocalDomain) == 0)
*p = '\0';
return (hp->h_name);
}