* Fix segfault due to poorly initialised value in rlm_mschap
* Added support for rejected packets to run an Post-Auth-Type REJECT
stanza instead of skipping post-auth entirely.
+ * Added support for %{check:Attribute-Name} to go with
+ %{request:Attribute-Name} and the like.
FreeRADIUS 0.9.1 ; Date: 2003/09/04 14:56:34, urgency=low
in request
%{reply:Attribute-Name} Corresponding value for Attribute-Name
in reply
+ %{check:Attribute-Name} Corresponding value for Attribute-Name
+ in check items for request
%{proxy-reply:Attribute-Name} Corresponding value for Attribute-Name
in the proxy reply (if it exists)
+
%{config:section.subsection.item} Corresponding value in 'radiusd.conf'
for the string value of that item.
return 0;
}
+/*
+ * Decode an attribute name from a particular VALUE_PAIR*
+ * into a string.
+ */
+static int decode_attr_vps(const char *from, char **to, int freespace,
+ VALUE_PAIR *vps,
+ RADIUS_ESCAPE_STRING func)
+
+{
+ DICT_ATTR *tmpda;
+ VALUE_PAIR *vp;
+
+ tmpda = dict_attrbyname(from);
+ if (!tmpda) return 0;
+
+ /*
+ * See if the VP is defined.
+ */
+ vp = pairfind(vps, tmpda->attr);
+ if (vp) {
+ *to += valuepair2str(*to, freespace, vp,
+ tmpda->type, func);
+ return 1;
+ }
+
+ return 0;
+}
/*
* Decode an attribute name into a string.
request->packet, func);
/*
+ * Find an attribute from the config items.
+ */
+ } else if (strncasecmp(attrname,"check:",6) == 0) {
+ found = decode_attr_vps(&attrname[6], &q, freespace,
+ request->config_items, func);
+
+ /*
* Find an attribute from the proxy request.
*/
} else if ((strncasecmp(attrname,"proxy-request:",14) == 0) &&