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
This commit is contained in:
Dag-Erling Smørgrav 2001-09-13 09:40:35 +00:00
parent ee52a08baa
commit f28f539f3c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=83402

View File

@ -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';
}