]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
be more flexible about %"
authorAlan T. DeKok <aland@freeradius.org>
Wed, 26 Feb 2025 12:39:27 +0000 (07:39 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 26 Feb 2025 12:39:27 +0000 (07:39 -0500)
src/main/xlat.c

index 7d3e3b92a2ad211fdcc5f452d5e2acd5fe09af1b..37cf6ebc8e64e58b5951f1f229c0003532920e94 100644 (file)
@@ -1516,6 +1516,16 @@ static ssize_t xlat_tokenize_literal(TALLOC_CTX *ctx, char *fmt, xlat_exp_t **he
                        ssize_t slen;
                        xlat_exp_t *next;
 
+                       /*
+                        *      %" is likely the end of a string inside of a string.
+                        *      We'll allow it.
+                        */
+                       if ((p[1] == '"') || (p[1] == '\'') || (p[1] == '`') || (p[1] == '/')) {
+                               p += 2;
+                               node->len += 2;
+                               continue;
+                       }
+
                        if (!strchr("%}cdelmntCDGHIMSTYv", p[1])) {
                                talloc_free(node);
                                *error = "Invalid variable expansion";