External shell script return value for inner-tunnel

Alan DeKok aland at deployingradius.com
Sat Aug 24 15:22:09 CEST 2019


On Aug 23, 2019, at 8:27 PM, Trevor Jennings <tjennings at gmail.com> wrote:
> My module looks like this:-
> ---
> exec bowdpersontype {
>  wait = yes
>  output_pairs = reply
>  shell_escape = yes
>  program = "/etc/freeradius/testldap.sh %{Stripped-User-Name}"
> }
> ---
> 
> This test script will output:-
> 
> echo "UserType=$bowdpersontype"

  What is the "UserType" attribute?  Where is it defined?

> And the inner tunnel:-
> 
> ---
>      bowdpersontype
> 
>      if (UserType =~ /STAFF/) {

  See "man unlang".  That is looking in the *request* list.  The "exec" module configuration is putting the attribute into the *reply* list.

>          update reply {
>              .....
>              .....
>           }
>     }
> ---
> 
> The debug output does show me the result from the external script and 'ok'
> message. How do I read the value to be used after the call?

  If you return a known attribute, *and* reference it in the right list, it will just work.

  Alan DeKok.




More information about the Freeradius-Users mailing list