From: Andrew Tridgell Date: Thu, 14 May 1998 04:31:03 +0000 (+0000) Subject: make host access controls case insensitive X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/5a96ee059968da5fd2ba4fbd6321bb3ee76b3c9d make host access controls case insensitive --- diff --git a/access.c b/access.c index f1a8bd75..046d5e31 100644 --- a/access.c +++ b/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); diff --git a/util.c b/util.c index ffbdc932..ed8d34e2 100644 --- a/util.c +++ b/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++; + } +}