Hi i have instantiate a script in /etc/freeradius/modules/exec exec myldap { wait = yes program = "/etc/freeradius/exec/ldap.sh %{%{Stripped-User-Name}:-%{User-Name}} %{NAS-IP-Address}" input_pairs = request shell_escape = yes output_pairs = reply } this script (ldap.sh) is simply making an echo on stdout like this radiusClass=<value> radiusFramedIPAddress=<value> ... I then inserted it in the radiusd.conf post_proxy { ... myldap ... } It runs the script but the output is never "used" after, and Freeradius doesn't want to "expand" the variables... I surely missed somthing... ---------(output part of freeradius -X) +- entering group post-proxy {...} expand: %{Stripped-User-Name} -> user1 expand: %{%{Stripped-User-Name}:-%{User-Name}} -> user1 expand: %{NAS-IP-Address} -> 192.168.1.2 Exec-Program output: radiusFramedIPAddress=1.2.3.4 radiusClass=mymaingroup Exec-Program-Wait: plaintext: radiusFramedIPAddress=1.2.3.4 radiusClass=mymaingroup Exec-Program: returned: 0 ++[myldap] returns ok Many thanks in advance for any help... Paul -- ============================ Paul TAVERNIER Equipe Reseaux-Securite Division Informatique Rectorat de ROUEN
---------(output part of freeradius -X) +- entering group post-proxy {...} expand: %{Stripped-User-Name} -> user1 expand: %{%{Stripped-User-Name}:-%{User-Name}} -> user1 expand: %{NAS-IP-Address} -> 192.168.1.2 Exec-Program output: radiusFramedIPAddress=1.2.3.4 radiusClass=mymaingroup Exec-Program-Wait: plaintext: radiusFramedIPAddress=1.2.3.4 radiusClass=mymaingroup Exec-Program: returned: 0 ++[myldap] returns ok
That looks fine.
It runs the script but the output is never "used" after, and Freeradius doesn't want to "expand" the variables...
I surely missed somthing...
"Used" where? Ivan Kalik Kalik Informatika ISP
Thanks for your fast reply... I solved in a way my problem, but one problem still remains... 1) The line should echo a valid radius Attribute (Framed-IP-Address=1.2.3.4 and not radiusFramedIPAddress=1.2.3.4)...(i'm a fool sometimes) (pb)==> 2) The script should send back ONLY ONE line. If i'm just echoing a single line from my script all is ok and the "output" printed is pushed back in the Access-Accept response to client...But if i'm echoing 2 Attributes...it fails. (they are printed out on ONE line on stdout, as you can see in the log in my first mail). So my new question is: Is it possible to print out 2 RadiusAttributes values in one script, or will i have to call 2 scripts producing each ONE line...? Rgds, Paul tnt@kalik.net wrote:
---------(output part of freeradius -X) +- entering group post-proxy {...} expand: %{Stripped-User-Name} -> user1 expand: %{%{Stripped-User-Name}:-%{User-Name}} -> user1 expand: %{NAS-IP-Address} -> 192.168.1.2 Exec-Program output: radiusFramedIPAddress=1.2.3.4 radiusClass=mymaingroup Exec-Program-Wait: plaintext: radiusFramedIPAddress=1.2.3.4 radiusClass=mymaingroup Exec-Program: returned: 0 ++[myldap] returns ok
That looks fine.
It runs the script but the output is never "used" after, and Freeradius doesn't want to "expand" the variables...
I surely missed somthing...
"Used" where?
Ivan Kalik Kalik Informatika ISP
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- ============================ Paul TAVERNIER Equipe Reseaux-Securite Division Informatique Rectorat de ROUEN Tel: 02.32.08.94.18 Fax: 02.32.08.94.12 Mob: 06.25.45.84.10 "Je suis accablé de tant de riens, si surchargé de billevesées" (Voltaire) ============================
I solved in a way my problem, but one problem still remains...
1) The line should echo a valid radius Attribute (Framed-IP-Address=1.2.3.4 and not radiusFramedIPAddress=1.2.3.4)...(i'm a fool sometimes)
(pb)==> 2) The script should send back ONLY ONE line. If i'm just echoing a single line from my script all is ok and the "output" printed is pushed back in the Access-Accept response to client...But if i'm echoing 2 Attributes...it fails. (they are printed out on ONE line on stdout, as you can see in the log in my first mail).
So my new question is: Is it possible to print out 2 RadiusAttributes values in one script, or will i have to call 2 scripts producing each ONE line...?
If you use perl you can return as many as you like. Ivan Kalik Kalik Informatika ISP
participants (2)
-
Paul TAVERNIER -
tnt@kalik.net