From ab1d18662aff536d540ec2b9447b6688264da531 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Fri, 10 Dec 2021 14:03:16 -0500 Subject: [PATCH] more fr_map_list fixes --- src/modules/rlm_json/rlm_json.c | 6 +++--- src/modules/rlm_ldap/rlm_ldap.c | 6 +++--- src/modules/rlm_radius/rlm_radius.c | 2 +- src/modules/rlm_radius/rlm_radius_udp.c | 2 +- src/modules/rlm_sql/rlm_sql.c | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/modules/rlm_json/rlm_json.c b/src/modules/rlm_json/rlm_json.c index f73f0f3035..b233f6c462 100644 --- a/src/modules/rlm_json/rlm_json.c +++ b/src/modules/rlm_json/rlm_json.c @@ -292,7 +292,7 @@ static int mod_map_proc_instantiate(CONF_SECTION *cs, UNUSED void *mod_inst, voi return -1; } - while ((map = fr_dlist_next(maps, map))) { + while ((map = fr_map_list_next(maps, map))) { CONF_PAIR *cp = cf_item_to_pair(map->ci); char const *p; @@ -343,7 +343,7 @@ static int mod_map_proc_instantiate(CONF_SECTION *cs, UNUSED void *mod_inst, voi * list member was pre-allocated and passed to the * instantiation callback. */ - if (fr_dlist_next(maps, map)) { + if (fr_map_list_next(maps, map)) { *tail = cache = talloc_zero(cache, rlm_json_jpath_cache_t); tail = &cache->next; } @@ -454,7 +454,7 @@ static rlm_rcode_t mod_map_proc(UNUSED void *mod_inst, void *proc_inst, request_ goto finish; } - while ((map = fr_dlist_next(maps, map))) { + while ((map = fr_map_list_next(maps, map))) { switch (map->rhs->type) { /* * Cached types diff --git a/src/modules/rlm_ldap/rlm_ldap.c b/src/modules/rlm_ldap/rlm_ldap.c index 6bcb6379e0..cb272bdf5d 100644 --- a/src/modules/rlm_ldap/rlm_ldap.c +++ b/src/modules/rlm_ldap/rlm_ldap.c @@ -833,9 +833,9 @@ static rlm_rcode_t mod_map_proc(void *mod_inst, UNUSED void *proc_inst, request_ } RINDENT(); - for (map = fr_dlist_head(maps), i = 0; + for (map = fr_map_list_head(maps), i = 0; map != NULL; - map = fr_dlist_next(maps, map), i++) { + map = fr_map_list_next(maps, map), i++) { int ret; fr_ldap_result_t attr; @@ -1418,7 +1418,7 @@ skip_edir: } } - if (!fr_dlist_empty(&inst->user_map) || inst->valuepair_attr) { + if (!fr_map_list_empty(&inst->user_map) || inst->valuepair_attr) { RDEBUG2("Processing user attributes"); RINDENT(); if (fr_ldap_map_do(request, handle, inst->valuepair_attr, diff --git a/src/modules/rlm_radius/rlm_radius.c b/src/modules/rlm_radius/rlm_radius.c index 039927ceeb..6f9e27f0dd 100644 --- a/src/modules/rlm_radius/rlm_radius.c +++ b/src/modules/rlm_radius/rlm_radius.c @@ -349,7 +349,7 @@ static int status_check_update_parse(TALLOC_CTX *ctx, void *out, UNUSED void *pa rcode = map_afrom_cs(ctx, head, cs, &parse_rules, &parse_rules, unlang_fixup_update, NULL, 128); if (rcode < 0) return -1; /* message already printed */ - if (fr_dlist_empty(head)) { + if (fr_map_list_empty(head)) { cf_log_err(cs, "'update' sections cannot be empty"); return -1; } diff --git a/src/modules/rlm_radius/rlm_radius_udp.c b/src/modules/rlm_radius/rlm_radius_udp.c index 3ffac7ef7c..b5e3a39721 100644 --- a/src/modules/rlm_radius/rlm_radius_udp.c +++ b/src/modules/rlm_radius/rlm_radius_udp.c @@ -370,7 +370,7 @@ static void CC_HINT(nonnull) status_check_alloc(udp_handle_t *h) * Create the VPs, and ignore any errors * creating them. */ - while ((map = fr_dlist_next(&inst->parent->status_check_map, map))) { + while ((map = fr_map_list_next(&inst->parent->status_check_map, map))) { /* * Skip things which aren't attributes. */ diff --git a/src/modules/rlm_sql/rlm_sql.c b/src/modules/rlm_sql/rlm_sql.c index 942e28c798..c672e411a7 100644 --- a/src/modules/rlm_sql/rlm_sql.c +++ b/src/modules/rlm_sql/rlm_sql.c @@ -486,9 +486,9 @@ static rlm_rcode_t mod_map_proc(void *mod_inst, UNUSED void *proc_inst, request_ * faster than building a radix tree each time the * map set is evaluated (map->rhs can be dynamic). */ - for (map = fr_dlist_head(maps), i = 0; + for (map = fr_map_list_head(maps), i = 0; map && (i < MAX_SQL_FIELD_INDEX); - map = fr_dlist_next(maps, map), i++) { + map = fr_map_list_next(maps, map), i++) { /* * Expand the RHS to get the name of the SQL field */ @@ -525,9 +525,9 @@ static rlm_rcode_t mod_map_proc(void *mod_inst, UNUSED void *proc_inst, request_ */ while (((ret = rlm_sql_fetch_row(&row, inst, request, &handle)) == RLM_SQL_OK)) { rows++; - for (map = fr_dlist_head(maps), j = 0; + for (map = fr_map_list_head(maps), j = 0; map && (j < MAX_SQL_FIELD_INDEX); - map = fr_dlist_next(maps, map), j++) { + map = fr_map_list_next(maps, map), j++) { if (field_index[j] < 0) continue; /* We didn't find the map RHS in the field set */ if (map_to_request(request, map, _sql_map_proc_get_value, row[field_index[j]]) < 0) goto error; } -- 2.47.2