Index: include/radius.h =================================================================== RCS file: /cvsroot/radius/radius/include/radius.h,v retrieving revision 1.66 diff -u -r1.66 radius.h --- include/radius.h 2 Nov 2003 21:44:28 -0000 1.66 +++ include/radius.h 3 Nov 2003 21:03:20 -0000 @@ -259,6 +259,7 @@ char realm[MAX_REALMNAME+1]; envar_t *args; RADIUS_SERVER_QUEUE *queue; + int case_sensitive; } REALM; typedef struct radius_req { Index: lib/realms.c =================================================================== RCS file: /cvsroot/radius/radius/lib/realms.c,v retrieving revision 1.12 diff -u -r1.12 realms.c --- lib/realms.c 31 Oct 2003 13:09:31 -0000 1.12 +++ lib/realms.c 3 Nov 2003 21:03:20 -0000 @@ -141,6 +141,8 @@ rp->queue->retries = envar_lookup_int(rp->args, "retries", 1); } + + rp->case_sensitive = envar_lookup_int(rp->args, "case", 1); } if (!realms) realms = list_create(); @@ -186,9 +188,13 @@ if (!itr) return NULL; - for (p = iterator_first(itr); p; p = iterator_next(itr)) - if (strcmp(p->realm, realm) == 0) + for (p = iterator_first(itr); p; p = iterator_next(itr)) { + int cmp = p->case_sensitive + ? strcmp(p->realm, realm) + : strcasecmp(p->realm, realm); + if (cmp == 0) break; + } if (!p && strcmp(realm, "NOREALM")) { for (p = iterator_first(itr); p; p = iterator_next(itr)) if (strcmp(p->realm, "DEFAULT") == 0)