From f28f539f3c84ca2daac97a6b23af30cc2aa24cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Thu, 13 Sep 2001 09:40:35 +0000 Subject: [PATCH] Add a strcasecmp() call I forgot in my hurry to commit the previous fix. Without this call, the hostname check would in some cases yield false positives. Pointed out by: ru --- usr.sbin/syslogd/syslogd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 1af1efa0e911..0eb22eaec74e 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1553,7 +1553,8 @@ cfline(line, f, prog, host) if (f->f_host[hl-1] == '.') f->f_host[--hl] = '\0'; dl = strlen(LocalDomain) + 1; - if (hl > dl && f->f_host[hl-dl] == '.') + if (hl > dl && f->f_host[hl-dl] == '.' && + strcasecmp(f->f_host + hl - dl + 1, LocalDomain) == 0) f->f_host[hl-dl] = '\0'; }