make host access controls case insensitive
This commit is contained in:
3
access.c
3
access.c
@@ -86,6 +86,9 @@ static int access_match(char *list, char *addr, char *host)
|
||||
|
||||
if (!list2) out_of_memory("access_match");
|
||||
|
||||
strlower(list2);
|
||||
if (host) strlower(host);
|
||||
|
||||
for (tok=strtok(list2," ,\t"); tok; tok=strtok(NULL," ,\t")) {
|
||||
if (match_hostname(host, tok) || match_address(addr, tok)) {
|
||||
free(list2);
|
||||
|
||||
12
util.c
12
util.c
@@ -531,3 +531,15 @@ void glob_expand(char **argv, int *argc, int maxargs)
|
||||
(*argc) += i;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
convert a string to lower case
|
||||
********************************************************************/
|
||||
void strlower(char *s)
|
||||
{
|
||||
while (*s) {
|
||||
if (isupper(*s)) *s = tolower(*s);
|
||||
s++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user