mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-18 10:35:55 +00:00
Slight adjustment to previous fix for __ivaliduser(). It was checking for
the comment before checking for long lines, so there was a possibility that the wrap-around might be used as an exploitable hostname. Reviewed by: Submitted by: Obtained from:
This commit is contained in:
parent
6263a19a10
commit
acc7e87c9b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=9552
@ -366,14 +366,16 @@ __ivaliduser(hostf, raddr, luser, ruser)
|
||||
return (-1);
|
||||
|
||||
while (fgets(buf, sizeof(buf), hostf)) {
|
||||
if(buf[0] == '#')
|
||||
continue;
|
||||
p = buf;
|
||||
/* Skip lines that are too long. */
|
||||
if (strchr(p, '\n') == NULL) {
|
||||
while ((ch = getc(hostf)) != '\n' && ch != EOF);
|
||||
continue;
|
||||
}
|
||||
if (*p == '\n' || *p == '#') {
|
||||
/* comment... */
|
||||
continue;
|
||||
}
|
||||
while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0') {
|
||||
*p = isupper(*p) ? tolower(*p) : *p;
|
||||
p++;
|
||||
|
Loading…
Reference in New Issue
Block a user