From: Alan T. DeKok Date: Wed, 28 Jan 2026 18:35:05 +0000 (-0500) Subject: just use %pV. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10c2909e52b7f1649784b03dae40771ba698c419;p=thirdparty%2Ffreeradius-server.git just use %pV. This was the only use of %pR, which prints un-escaped values. except that the debug output also wrapped the output in quotes, \"%pR\", which pretty much negated the utility of not escaping the output --- diff --git a/src/lib/server/tmpl_tokenize.c b/src/lib/server/tmpl_tokenize.c index 98af073244c..71c59d688b3 100644 --- a/src/lib/server/tmpl_tokenize.c +++ b/src/lib/server/tmpl_tokenize.c @@ -324,7 +324,7 @@ void tmpl_debug(FILE *fp, tmpl_t const *vpt) break; } - fprintf(fp, "tmpl_t %s (%.8x) \"%pR\" (%p)\n", + fprintf(fp, "tmpl_t %s (%.8x) %pV (%p)\n", tmpl_type_to_str(vpt->type), vpt->type, vpt->name, vpt); diff --git a/src/lib/util/print.c b/src/lib/util/print.c index a330feb5d1b..43ba190cecb 100644 --- a/src/lib/util/print.c +++ b/src/lib/util/print.c @@ -669,21 +669,14 @@ static char *fr_vasprintf_internal(TALLOC_CTX *ctx, char const *fmt, va_list ap, */ switch (*(p + 1)) { case 'V': - case 'R': { fr_value_box_t const *in = va_arg(ap_q, fr_value_box_t const *); fr_sbuff_escape_rules_t const *e_rules = NULL; /* - * Value boxes get escaped as double-quoted strings, unless the value-box - * in question is secret, AND we've been asked to hide secrets. - * - * Note that the secret_rules only hides secrets of data type "string", - * which should be good enough for most purposes. + * Value boxes get escaped as double-quoted strings. */ - if (*(p + 1) == 'V') { - e_rules = &fr_value_escape_double; - } + e_rules = &fr_value_escape_double; /* * Allocations that are not part of the output