]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rlm_sql: Use the non-xlat escape function for the group membership query
authorTerry Burton <tez@terryburton.co.uk>
Mon, 2 Nov 2020 23:46:10 +0000 (23:46 +0000)
committerAlan DeKok <aland@freeradius.org>
Tue, 3 Nov 2020 12:52:41 +0000 (07:52 -0500)
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.

src/modules/rlm_sql/rlm_sql.c

index 0c872ea24653a1b68a71a56072b4324fe06e321a..3838ab1169e79b26a614c1a11c1a7756e7f40442 100644 (file)
@@ -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);