]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
these don't use (and shouldn't use) VT_XLAT
authorAlan T. DeKok <aland@freeradius.org>
Fri, 10 Dec 2021 21:13:59 +0000 (16:13 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 10 Dec 2021 21:13:59 +0000 (16:13 -0500)
in preparation for simply removing it entirely.

src/bin/dhcpclient.c
src/bin/radclient.c
src/bin/radsniff.c
src/bin/unit_test_module.c

index 1086ba33f825f1ee3a47c1f8069ef26f38691f8a..1e6e8cf52de3d18a7c77561b989c01e842f024b1 100644 (file)
@@ -181,22 +181,7 @@ static int request_init(fr_radius_packet_t **out, fr_pair_list_t *packet_vps, ch
        for (vp = fr_pair_list_head(packet_vps);
             vp;
             vp = fr_pair_list_next(packet_vps, vp)) {
-
-               /*
-                *      Xlat expansions are not supported. Convert xlat to value box (if possible).
-                */
-               if (vp->type == VT_XLAT) {
-                       if (fr_value_box_from_str(vp, &vp->data,
-                                                 vp->da->type, NULL,
-                                                 vp->xlat, strlen(vp->xlat),
-                                                 NULL, false) < 0) {
-                               fr_perror("dhcpclient");
-                               fr_radius_packet_free(&packet);
-                               if (fp && (fp != stdin)) fclose(fp);
-                               return -1;
-                       }
-                       vp->type = VT_DATA;
-               }
+               fr_assert(vp->type != VT_XLAT);
 
                /*
                 *      Allow to set packet type using Message-Type
index 24f3313595e092c0a488faf070ba93b537a36271..dade6025de009d6c3bf9fd94363b200e3670856a 100644 (file)
@@ -453,19 +453,7 @@ static int radclient_init(TALLOC_CTX *ctx, rc_file_pair_t *files)
                             vp;
                             vp = fr_pair_list_next(&request->filter, vp)) {
                             again:
-                               /*
-                                *      Xlat expansions are not supported. Convert xlat to value box (if possible).
-                                */
-                               if (vp->type == VT_XLAT) {
-                                       if (fr_value_box_from_str(vp, &vp->data,
-                                                                 vp->da->type, NULL,
-                                                                 vp->xlat, strlen(vp->xlat),
-                                                                 NULL, false) < 0) {
-                                               fr_perror("radclient");
-                                               goto error;
-                                       }
-                                       vp->type = VT_DATA;
-                               }
+                               fr_assert(vp->type != VT_XLAT);
 
                                if (vp->da == attr_packet_type) {
                                        fr_pair_t *next;
@@ -490,18 +478,7 @@ static int radclient_init(TALLOC_CTX *ctx, rc_file_pair_t *files)
                for (vp = fr_pair_list_head(&request->request_pairs);
                     vp;
                     vp = fr_pair_list_next(&request->request_pairs, vp)) {
-                       /*
-                        *      Xlat expansions are not supported. Convert xlat to value box (if possible).
-                        */
-                       if (vp->type == VT_XLAT) {
-                               if (fr_value_box_from_str(vp, &vp->data, vp->da->type, NULL,
-                                                         vp->xlat, strlen(vp->xlat),
-                                                         NULL, false) < 0) {
-                                       fr_perror("radclient");
-                                       goto error;
-                               }
-                               vp->type = VT_DATA;
-                       }
+                       fr_assert(vp->type != VT_XLAT);
 
                        /*
                         *      Allow it to set the packet type in
index bb5bac37e0ff2547b3f50508718482918d65ccc3..4c2b07848ee9c61b8fc6a2f399c54cb1ba46dc26 100644 (file)
@@ -2030,7 +2030,6 @@ static int rs_build_dict_list(fr_dict_attr_t const **out, size_t len, char *list
 
 static int rs_build_filter(fr_pair_list_t *out, char const *filter)
 {
-       fr_pair_t *vp;
        fr_token_t code;
 
        code = fr_pair_list_afrom_str(conf, dict_radius, filter, strlen(filter), out);
@@ -2044,23 +2043,6 @@ static int rs_build_filter(fr_pair_list_t *out, char const *filter)
                return -1;
        }
 
-       for (vp = fr_pair_list_head(out);
-            vp;
-            vp = fr_pair_list_next(out, vp)) {
-               /*
-                *      Xlat expansions are not supported. Convert xlat to value box (if possible).
-                */
-               if (vp->type == VT_XLAT) {
-                       if (fr_value_box_from_str(vp, &vp->data, vp->da->type, NULL,
-                                                 vp->xlat, strlen(vp->xlat),
-                                                 NULL, false) < 0) {
-                               fr_perror("radsniff");
-                               return -1;
-                       }
-                       vp->type = VT_DATA;
-               }
-       }
-
        /*
         *      This allows efficient list comparisons later
         */
index cb6566eec6a90a348a2e1b5033a3b2a92a74fbaa..a63318a5e425ba8cb3d613e362ca9073fad94492 100644 (file)
@@ -226,15 +226,7 @@ static request_t *request_from_file(TALLOC_CTX *ctx, FILE *fp, RADCLIENT *client
        for (vp = fr_pair_dcursor_init(&cursor, &request->request_pairs);
             vp;
             vp = fr_dcursor_next(&cursor)) {
-               /*
-                *      Double quoted strings get marked up as xlat expansions,
-                *      but we don't support that here.
-                */
-               if (vp->type == VT_XLAT) {
-                       fr_pair_value_bstrdup_buffer_shallow(vp, vp->xlat, false);
-                       vp->xlat = NULL;
-                       vp->type = VT_DATA;
-               }
+               fr_assert(vp->type != VT_XLAT);
 
                if (vp->da == attr_packet_type) {
                        request->packet->code = vp->vp_uint32;