diff --git a/src/modules/rlm_realm/rlm_realm.c b/src/modules/rlm_realm/rlm_realm.c index 6006769..2da7211 100644 --- a/src/modules/rlm_realm/rlm_realm.c +++ b/src/modules/rlm_realm/rlm_realm.c @@ -197,13 +197,16 @@ static int check_for_realm(void *instance, REQUEST *request, REALM **returnrealm /* * Add the realm name to the request. - * If the realm is a regex, the use the realm as entered - * by the user. Otherwise, use the configured realm name, - * as realm name comparison is case insensitive. We want - * to use the configured name, rather than what the user + * If the realm is a regex or DEFAULT, then use the realm + * as entered by the user. Otherwise, use the configured + * realm name, as realm name comparison is case insensitive. + * We want to use the configured name, rather than what the user * entered. */ - if (realm->name[0] != '~') realmname = realm->name; + if (realm->name[0] != '~') { + if (strcmp(realm->name, "DEFAULT") != 0) + realmname = realm->name; + } pairadd(&request->packet->vps, pairmake("Realm", realmname, T_OP_EQ)); RDEBUG2("Adding Realm = \"%s\"", realmname);