On Tue, Jul 29, 2003 at 10:52:59AM -0400, Alan DeKok wrote:
> "Alexander M. Pravking" <[EMAIL PROTECTED]> wrote:
> > > > By the way, %{Simultaneuos-Use} will not work, since there's no way to
> > > > expand check items from the request...
> > >
> > > Nonsense. See 'doc/variables.txt'
> >
> > Huh?
>
> Hmm... if it's not there, then it's trivial enough to add. ~10
> lines in src/main/xlat.c should do it.
Here's a patch. I used "check:" as a prefix, maybe someone suggests more
reasonable one?
Index: doc/variables.txt
===================================================================
RCS file: /source/radiusd/doc/variables.txt,v
retrieving revision 1.7
diff -u -p -r1.7 variables.txt
--- doc/variables.txt 11 Apr 2003 17:54:58 -0000 1.7
+++ doc/variables.txt 29 Jul 2003 16:16:06 -0000
@@ -4,6 +4,8 @@ The variables defined by the server are:
in request
%{request:Attribute-Name} Corresponding value for Attribute-Name
in request
+ %{check:Attribute-Name} Corresponding value for Attribute-Name
+ in check items
%{reply:Attribute-Name} Corresponding value for Attribute-Name
in reply
%{proxy-reply:Attribute-Name} Corresponding value for Attribute-Name
@@ -12,9 +14,9 @@ The variables defined by the server are:
%{config:section.subsection.item} Corresponding value in 'radiusd.conf'
for the string value of that item.
- The %{config:...} variables should be used VERY carefully, as they
-may leak secret information from your RADIUS server, if you use them
-in reply attributes to the NAS!
+ The %{config:...} and %{check:... } variables should be used VERY
+carefully, as they may leak secret information from your RADIUS server,
+if you use them in reply attributes to the NAS!
e.g.
Index: src/main/xlat.c
===================================================================
RCS file: /source/radiusd/src/main/xlat.c,v
retrieving revision 1.55
diff -u -p -r1.55 xlat.c
--- src/main/xlat.c 18 Mar 2003 05:50:54 -0000 1.55
+++ src/main/xlat.c 29 Jul 2003 16:17:53 -0000
@@ -232,6 +232,16 @@ static void decode_attribute(const char
}
/*
+ * Find an attibute from the config items
+ */
+ } else if (strncasecmp(attrname,"check:",6) == 0) {
+ if((tmpda = dict_attrbyname(&attrname[6])) &&
+ (tmppair = pairfind(request->config_items,
tmpda->attr))) {
+ q += valuepair2str(q,freespace,tmppair,tmpda->type, func);
+ found = 1;
+ }
+
+ /*
* Find an attribute from the request.
*/
} else if (strncasecmp(attrname,"request:",8) == 0) {
--
Fduch M. Pravking
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html