From 3e67a0e670f8ce66bf6abb94fc08509d041a96f9 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Wed, 4 Sep 2013 08:33:45 -0400 Subject: [PATCH] Skip '&' on attribute maps. Closes #423 And check return codes from request_name / list_name --- src/main/map.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/map.c b/src/main/map.c index 8476499..b4fd5a1 100644 --- a/src/main/map.c +++ b/src/main/map.c @@ -157,13 +157,18 @@ value_pair_tmpl_t *radius_str2tmpl(TALLOC_CTX *ctx, char const *name, FR_TOKEN t switch (type) { case T_BARE_WORD: + if (*name == '&') name++; + if (!isdigit((int) *name)) { request_refs_t ref; pair_lists_t list; char const *p = name; ref = radius_request_name(&p, REQUEST_CURRENT); + if (ref == REQUEST_UNKNOWN) goto literal; + list = radius_list_name(&p, PAIR_LIST_REQUEST); + if (list == PAIR_LIST_UNKNOWN) goto literal; if ((p != name) && !*p) { vpt->type = VPT_TYPE_LIST; @@ -186,6 +191,7 @@ value_pair_tmpl_t *radius_str2tmpl(TALLOC_CTX *ctx, char const *name, FR_TOKEN t /* FALL-THROUGH */ case T_SINGLE_QUOTED_STRING: + literal: vpt->type = VPT_TYPE_LITERAL; break; case T_DOUBLE_QUOTED_STRING: -- 2.1.4