From: Alan T. DeKok Date: Tue, 5 Jul 2022 17:43:12 +0000 (-0400) Subject: Revert "map_afrom_cp: unescape double-quoted and back-quoted RHS prior to parsing... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9d1876e9fb668f25dad893e2fe19d5f8e7121db;p=thirdparty%2Ffreeradius-server.git Revert "map_afrom_cp: unescape double-quoted and back-quoted RHS prior to parsing it (#4590)" This reverts commit db35ae505b78437f1a726f0635cf6ef7a0d16ce3. this breaks many unit tests. We will need a better fix. --- diff --git a/src/lib/server/map.c b/src/lib/server/map.c index 972f095af0e..a7d5acd6de0 100644 --- a/src/lib/server/map.c +++ b/src/lib/server/map.c @@ -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;