]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't allow: Foo = %{...}
authorAlan T. DeKok <aland@freeradius.org>
Sun, 29 Aug 2021 12:26:34 +0000 (08:26 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 29 Aug 2021 12:26:34 +0000 (08:26 -0400)
it must be in a double-quoted string.

src/main/map.c

index 4396ed63edf3c4fc47fcc0d8a1b6e5921d3a6a8b..97a68da5fc5c15bee31fecdbcfeee428fd354239 100644 (file)
@@ -245,6 +245,18 @@ int map_afrom_cp(TALLOC_CTX *ctx, vp_map_t **out, CONF_PAIR *cp,
                }
                break;
 
+       case T_BARE_WORD:
+               /*
+                *      Foo = %{...}
+                *
+                *      Not allowed!
+                */
+               if ((attr[0] == '%') && (attr[1] == '{')) {
+                       cf_log_err_cp(cp, "Bare expansions are not permitted.  They must be in a double-quoted string.");
+                       goto error;
+               }
+               /* FALL-THROUGH */
+
        default:
                slen = tmpl_afrom_attr_str(ctx, &map->lhs, attr, dst_request_def, dst_list_def, true, true);
                if (slen <= 0) {