]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Handle adding of individual vps in mod_vptuple()
authorNick Porter <nick@portercomputing.co.uk>
Sat, 9 Jan 2021 14:32:18 +0000 (14:32 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 21 Jan 2021 23:05:49 +0000 (23:05 +0000)
VPs are added to a temporary list and then the whole list
radius_pairmove() added to the destination.

src/modules/rlm_python/rlm_python.c

index 075a7ddc6cb05516fd6976b95b68142f59918755..400f280bf810e9bab6b14c8a48417d8d4a776d2a 100644 (file)
@@ -250,7 +250,9 @@ static void mod_vptuple(TALLOC_CTX *ctx, rlm_python_t const *inst, request_t *re
        tmpl_t  *dst;
        fr_pair_t       *vp;
        request_t               *current = request;
+       fr_pair_list_t  tmp_list;
 
+       fr_pair_list_init(&tmp_list);
        /*
         *      If the Python function gave us None for the tuple,
         *      then just return.
@@ -350,8 +352,9 @@ static void mod_vptuple(TALLOC_CTX *ctx, rlm_python_t const *inst, request_t *re
                              fr_table_str_by_value(fr_tokens_table, op, "="), s2);
                }
 
-               radius_pairmove(request,  vps, &vp, false);
+               fr_pair_add(&tmp_list, vp);
        }
+       radius_pairmove(request, vps, &tmp_list, false);
 }