]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Revert "map_afrom_cp: unescape double-quoted and back-quoted RHS prior to parsing...
authorAlan T. DeKok <aland@freeradius.org>
Tue, 5 Jul 2022 17:43:12 +0000 (13:43 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 5 Jul 2022 17:43:12 +0000 (13:43 -0400)
This reverts commit db35ae505b78437f1a726f0635cf6ef7a0d16ce3.

this breaks many unit tests.  We will need a better fix.

src/lib/server/map.c

index 972f095af0e1af4c436e32b3d416dc9bf28024c0..a7d5acd6de0107d0b55c693643b468db6b63999b 100644 (file)
@@ -99,7 +99,6 @@ int map_afrom_cp(TALLOC_CTX *ctx, map_t **out, map_t *parent, CONF_PAIR *cp,
 {
        map_t           *map;
        char const      *attr, *value, *marker_subject;
-       fr_sbuff_parse_rules_t const *p_rules;
        ssize_t         slen;
        fr_token_t      type;
 
@@ -165,23 +164,11 @@ int map_afrom_cp(TALLOC_CTX *ctx, map_t **out, map_t *parent, CONF_PAIR *cp,
         *      RHS might be an attribute reference.
         */
        type = cf_pair_value_quote(cp);
-       p_rules = value_parse_rules_unquoted[type]; /* We're not searching for quotes */
-       if (type == T_DOUBLE_QUOTED_STRING || type == T_BACK_QUOTED_STRING) {
-               char *unescaped_value;
-               slen = fr_sbuff_out_aunescape_until(map, &unescaped_value,
-                               &FR_SBUFF_IN(value, strlen(value)), SIZE_MAX, p_rules->terminals, p_rules->escapes);
-               if (slen < 0) {
-                       marker_subject = value;
-                       goto marker;
-               }
-               value = unescaped_value;
-               p_rules = NULL;
-       }
 
        slen = tmpl_afrom_substr(map, &map->rhs,
                                 &FR_SBUFF_IN(value, strlen(value)),
                                 type,
-                                p_rules,
+                                value_parse_rules_unquoted[type],      /* We're not searching for quotes */
                                 rhs_rules);
        if (slen < 0) {
                marker_subject = value;