From: Terry Burton Date: Mon, 2 Nov 2020 23:46:10 +0000 (+0000) Subject: rlm_sql: Use the non-xlat escape function for the group membership query X-Git-Tag: release_3_0_22~352 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0b48c07ba986b09c75fbb3bb4036c830ec715c5;p=thirdparty%2Ffreeradius-server.git rlm_sql: Use the non-xlat escape function for the group membership query Use the basic sql_escape_func when expanding the group membership query that uses our existing SQL handle. If we use sql_escape_for_xlat_func, which reserves a connection, then when the connection pool is exhausted we erroneously conclude that the user is not a member of any groups. --- diff --git a/src/modules/rlm_sql/rlm_sql.c b/src/modules/rlm_sql/rlm_sql.c index 0c872ea2465..3838ab1169e 100644 --- a/src/modules/rlm_sql/rlm_sql.c +++ b/src/modules/rlm_sql/rlm_sql.c @@ -573,7 +573,7 @@ static int sql_get_grouplist(rlm_sql_t *inst, rlm_sql_handle_t **handle, REQUEST if (!inst->config->groupmemb_query) return 0; - if (radius_axlat(&expanded, request, inst->config->groupmemb_query, sql_escape_for_xlat_func, inst) < 0) return -1; + if (radius_axlat(&expanded, request, inst->config->groupmemb_query, sql_escape_func, *handle) < 0) return -1; ret = rlm_sql_select_query(inst, request, handle, expanded); talloc_free(expanded);