From: Alan T. DeKok Date: Wed, 4 Sep 2013 14:41:52 +0000 (-0400) Subject: Use the default request if there's no "." in the reference. X-Git-Tag: release_3_0_0_rc1~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6c11dbdb704f9a6bc5cb2701b4ac974b162a260e;p=thirdparty%2Ffreeradius-server.git Use the default request if there's no "." in the reference. update outer.reply { User-Name := foo } ends up parsing "User-Name" with a default list of "outer", BUT because "User-Name" has no ".", the old code would return a hard-coded CURRENT --- diff --git a/src/main/map.c b/src/main/map.c index b4fd5a109c..2acada5fca 100644 --- a/src/main/map.c +++ b/src/main/map.c @@ -492,7 +492,7 @@ int radius_attrmap(CONF_SECTION *cs, value_pair_map_t **head, cs_list = p = cf_section_name2(cs); if (cs_list) { - request_def = radius_request_name(&p, REQUEST_UNKNOWN); + request_def = radius_request_name(&p, REQUEST_CURRENT); if (request_def == REQUEST_UNKNOWN) { cf_log_err(ci, "Default request specified " "in mapping section is invalid"); diff --git a/src/main/util.c b/src/main/util.c index 51c5721a06..9850ff0372 100644 --- a/src/main/util.c +++ b/src/main/util.c @@ -970,7 +970,7 @@ request_refs_t radius_request_name(char const **name, request_refs_t def) p = strchr(*name, '.'); if (!p) { - return REQUEST_CURRENT; + return def; } /* @@ -980,7 +980,7 @@ request_refs_t radius_request_name(char const **name, request_refs_t def) p - *name); /* - * If we get a VALID LIST, skip it. + * If we get a valid name, skip it. */ if (request != REQUEST_UNKNOWN) { *name = p + 1;