make host access controls case insensitive

This commit is contained in:
Andrew Tridgell
1998-05-14 04:31:03 +00:00
parent 0cea42440f
commit 5a96ee0599
2 changed files with 15 additions and 0 deletions

View File

@@ -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
View File

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