mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fix _listmatch() again so that it works with group lists containing only
one group. Thanks to Dirk Froemberg for supplying a patch for this. I will be closing out the PR and moving this to the 2.2.5 branch later: my login sessions to freefall from Columbia are ridiculously spotty today. PR: 5610 Submitted by: Dirk Froemberg <ibex@physik.TU-Berlin.DE>
This commit is contained in:
parent
be41061b8b
commit
12228287c1
1 changed files with 14 additions and 7 deletions
|
|
@ -286,14 +286,21 @@ static int _listmatch(list, group, len)
|
|||
while(isspace(*ptr))
|
||||
ptr++;
|
||||
|
||||
while (ptr < list + len) {
|
||||
cptr = ptr;
|
||||
while(*ptr != ',' && !isspace(*ptr))
|
||||
ptr++;
|
||||
if (strncmp(cptr, group, glen) == 0 && glen == (ptr - cptr))
|
||||
if (strchr(list, ',') == NULL) {
|
||||
if (strncmp(ptr, group, glen) == 0) {
|
||||
return(1);
|
||||
while(*ptr == ',' || isspace(*ptr))
|
||||
ptr++;
|
||||
}
|
||||
} else {
|
||||
while (ptr < list + len) {
|
||||
cptr = ptr;
|
||||
while(*ptr != ',' && !isspace(*ptr))
|
||||
ptr++;
|
||||
if (strncmp(cptr, group, glen) == 0 &&
|
||||
glen == (ptr - cptr))
|
||||
return(1);
|
||||
while(*ptr == ',' || isspace(*ptr))
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue