]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
just use %pV.
authorAlan T. DeKok <aland@freeradius.org>
Wed, 28 Jan 2026 18:35:05 +0000 (13:35 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 28 Jan 2026 18:37:02 +0000 (13:37 -0500)
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

src/lib/server/tmpl_tokenize.c
src/lib/util/print.c

index 98af073244cec96aa97c6d72f6f1458795e20006..71c59d688b3b833260a4685e262c2918ea35992f 100644 (file)
@@ -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);
index a330feb5d1b1b959df09a68bd46f90192ce74af4..43ba190cecb981aa702bd32ac2e66164c041797e 100644 (file)
@@ -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