From: Nick Porter Date: Mon, 8 Apr 2024 13:07:54 +0000 (+0100) Subject: Correct handling of cache_groups option X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=244ae59774fee555dbb57a6cfcc4bb58b8dc06c9;p=thirdparty%2Ffreeradius-server.git Correct handling of cache_groups option --- diff --git a/src/modules/rlm_sql/rlm_sql.c b/src/modules/rlm_sql/rlm_sql.c index f3d86531a4e..70377aa4e34 100644 --- a/src/modules/rlm_sql/rlm_sql.c +++ b/src/modules/rlm_sql/rlm_sql.c @@ -92,6 +92,7 @@ static const conf_parser_t module_config[] = { { FR_CONF_OFFSET("read_groups", rlm_sql_config_t, read_groups), .dflt = "yes" }, { FR_CONF_OFFSET_FLAGS("sql_user_name", CONF_FLAG_XLAT, rlm_sql_config_t, query_user), .dflt = "" }, { FR_CONF_OFFSET("group_attribute", rlm_sql_config_t, group_attribute) }, + { FR_CONF_OFFSET("cache_groups", rlm_sql_config_t, cache_groups) }, { FR_CONF_OFFSET_FLAGS("logfile", CONF_FLAG_XLAT, rlm_sql_config_t, logfile) }, { FR_CONF_OFFSET("open_query", rlm_sql_config_t, connect_query) }, @@ -947,7 +948,7 @@ static int sql_check_groupmemb(rlm_sql_t const *inst, request_t *request, rlm_sq map_list_talloc_free(&check_tmp); if (inst->config.cache_groups) { - MEM(pair_update_control(&vp, inst->group_da) >= 0); + MEM(pair_append_control(&vp, inst->group_da) >= 0); fr_pair_value_strdup(vp, group_name, true); added = true; } @@ -999,7 +1000,7 @@ static int sql_check_groupmemb(rlm_sql_t const *inst, request_t *request, rlm_sq } if (inst->config.cache_groups && !added) { - MEM(pair_update_control(&vp, inst->group_da) >= 0); + MEM(pair_append_control(&vp, inst->group_da) >= 0); fr_pair_value_strdup(vp, group_name, true); }