From a95f9650af7816827442e84d92a4e6f2c8c14e0c Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Wed, 26 Feb 2025 07:39:27 -0500 Subject: [PATCH] be more flexible about %" --- src/main/xlat.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/xlat.c b/src/main/xlat.c index 7d3e3b92a2..37cf6ebc8e 100644 --- a/src/main/xlat.c +++ b/src/main/xlat.c @@ -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"; -- 2.47.2