return 0;
}
+int radius_legacy_map_list_apply(request_t *request, map_list_t const *list)
+{
+ map_t const *map;
+
+ for (map = map_list_head(list);
+ map != NULL;
+ map = map_list_next(list, map)) {
+ RDEBUG2("&%s %s %s", map->lhs->name, fr_tokens[map->op],
+ map->rhs ? map->rhs->name : "{ ... }");
+
+ if (radius_legacy_map_apply(request, map) < 0) return -1;
+ }
+
+ return 0;
+}
+
int radius_legacy_map_cmp(request_t *request, map_t const *map)
{
int rcode;
int radius_legacy_map_apply(request_t *request, map_t const *map) CC_HINT(nonnull);
+int radius_legacy_map_list_apply(request_t *request, map_list_t const *list) CC_HINT(nonnull);
+
int radius_legacy_map_cmp(request_t *request, map_t const *map) CC_HINT(nonnull);
#ifdef __cplusplus
while (user_pl || default_pl) {
map_t *map = NULL;
PAIR_LIST const *pl;
- bool next_shortest_prefix;
bool match = true;
/*
RDEBUG2("Found match \"%s\" on line %d of %s", pl->name, pl->lineno, pl->filename);
found = true;
- next_shortest_prefix = false;
/* ctx may be reply */
- if (!map_list_empty(&pl->reply)) {
- map = NULL;
-
- while ((map = map_list_next(&pl->reply, map))) {
- if (radius_legacy_map_apply(request, map) < 0) {
- RPWARN("Failed parsing map for reply item %s, skipping it", map->lhs->name);
- break;
- }
- }
-
- next_shortest_prefix = pl->next_shortest_prefix;
+ if (radius_legacy_map_list_apply(request, &pl->reply) < 0) {
+ RPWARN("Failed parsing map for reply item %s", map->lhs->name);
+ RETURN_MODULE_FAIL;
}
if (pl->fall_through) {
* We're doing patricia tries, but we've been
* told to not walk back up the trie, OR we're at the top of the tree. Stop.
*/
- if (!next_shortest_prefix || (keylen == 0)) {
+ if (!pl->next_shortest_prefix || (keylen == 0)) {
break;
}
}
if (inst->config.authorize_group_reply_query) {
- map_t *map;
-
/*
* Now get the reply pairs since the paircmp matched
*/
RDEBUG2("Group \"%s\": Merging reply items", group_name);
*rcode = RLM_MODULE_UPDATED;
- for (map = map_list_head(&reply_tmp);
- map != NULL;
- map = map_list_next(&reply_tmp, map)) {
- RDEBUG2("&%s %s %s", map->lhs->name, fr_tokens[map->op], map->rhs->name);
-
- if (radius_legacy_map_apply(request, map) < 0) {
- RPEDEBUG("Failed applying reply item");
- map_list_talloc_free(&reply_tmp);
- return -1;
- }
+ if (radius_legacy_map_list_apply(request, &reply_tmp) < 0) {
+ RPEDEBUG("Failed applying reply item");
+ map_list_talloc_free(&reply_tmp);
+ return -1;
}
map_list_talloc_free(&reply_tmp);
}
if (inst->config.authorize_reply_query) {
- map_t *map;
-
/*
* Now get the reply pairs since the paircmp matched
*/
RDEBUG2("User found in radreply table, merging reply items");
user_found = true;
- for (map = map_list_head(&reply_tmp);
- map != NULL;
- map = map_list_next(&reply_tmp, map)) {
- RDEBUG2("&%s %s %s", map->lhs->name, fr_tokens[map->op],
- map->rhs ? map->rhs->name : "{ ... }");
-
- if (radius_legacy_map_apply(request, map) < 0) {
- RPEDEBUG("Failed applying reply item");
- map_list_talloc_free(&reply_tmp);
- rcode = RLM_MODULE_FAIL;
- goto error;
- }
+ if (radius_legacy_map_list_apply(request, &reply_tmp) < 0) {
+ RPEDEBUG("Failed applying reply item");
+ map_list_talloc_free(&reply_tmp);
+ rcode = RLM_MODULE_FAIL;
+ goto error;
}
map_list_talloc_free(&reply_tmp);
Reply-Message += "success2"
overwritereply Password.Cleartext := "testing123"
- Reply-Message := "firstpass",
+ Reply-Message := "firstpass1",
+ Reply-Message += "firstpass2",
+ Reply-Message += "firstpass3",
Fall-Through = yes
overwritereply Password.Cleartext := "testing123"