From: Nick Porter Date: Thu, 2 Nov 2023 11:40:49 +0000 (+0000) Subject: No point evaluating SQL-User-Name after the query has been built X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09d25d7dec8bfea637faac8480bfb252c10a5ff3;p=thirdparty%2Ffreeradius-server.git No point evaluating SQL-User-Name after the query has been built To use SQL-User-Name in an SQL map, it needs to be populated before the value box list of the query is created. --- diff --git a/src/modules/rlm_sql/rlm_sql.c b/src/modules/rlm_sql/rlm_sql.c index 5b65a067cc2..7692b8ebd3e 100644 --- a/src/modules/rlm_sql/rlm_sql.c +++ b/src/modules/rlm_sql/rlm_sql.c @@ -436,13 +436,6 @@ static unlang_action_t mod_map_proc(rlm_rcode_t *p_result, void *mod_inst, UNUSE for (i = 0; i < MAX_SQL_FIELD_INDEX; i++) field_index[i] = -1; - /* - * Add SQL-User-Name attribute just in case it is needed - * We could search the string fmt for SQL-User-Name to see if this is - * needed or not - */ - sql_set_user(inst, request, NULL); - handle = fr_pool_connection_get(inst->pool, request); /* connection pool should produce error */ if (!handle) { RETURN_MODULE_FAIL; @@ -891,7 +884,7 @@ static bool paircmp(request_t *request, fr_pair_list_t *check_list) */ return true; } - + static int sql_check_groupmemb(rlm_sql_t const *inst, request_t *request, rlm_sql_handle_t **handle, fr_pair_t *sql_group, char const *group_name, sql_fall_through_t *do_fall_through, rlm_rcode_t *rcode)