make host access controls case insensitive
authorAndrew Tridgell <tridge@samba.org>
Thu, 14 May 1998 04:31:03 +0000 (04:31 +0000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 14 May 1998 04:31:03 +0000 (04:31 +0000)
access.c
util.c

index f1a8bd7..046d5e3 100644 (file)
--- 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");
 
 
        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);
        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 ffbdc93..ed8d34e 100644 (file)
--- a/util.c
+++ b/util.c
@@ -531,3 +531,15 @@ void glob_expand(char **argv, int *argc, int maxargs)
        (*argc) += i;
 #endif
 }
        (*argc) += i;
 #endif
 }
+
+
+/*******************************************************************
+  convert a string to lower case
+********************************************************************/
+void strlower(char *s)
+{
+       while (*s) {
+               if (isupper(*s)) *s = tolower(*s);
+               s++;
+       }
+}