Variable passing question between modules

Alan DeKok aland at deployingradius.com
Fri Nov 1 17:10:48 CET 2019


On Nov 1, 2019, at 11:48 AM, Adam Taylor <ataylor at ulm.edu> wrote:
> I have been trying for a week and I have everything working on a setup I am doing except for one thing.  Setting Tmp-String-0 to a string and using that string in the LDAP module.

  That should be simple enough.

> I'm trying to make the config as simple as possible so if I am doing something wrong, please let me know.
> 
> I have the following in my authorize section:
> 
> authorize {
>        if (User-Name =~ /@ulm\.edu$$/i){
>                update request {
>                        Tmp-String-0 = "Employees"
>                }

  OK...

> Basically if the login is XXX at ulm.edu<mailto:XXX at ulm.edu> set TMP-String-0 to "Employees" or if XXX at warhawks.ulm.edu<mailto:XXX at warhawks.ulm.edu> set to "Students"
> 
> I then have the following in my ldap config:
> 
>        base_dn = 'ou=%{request:Tmp-String-0},ou=People,dc=ulm,dc=edu'

  That should be a double-quotes string, not single quotes.  But OK>

> The problem is ${request:Tmp-String-0} is always null and I get this in debug:
> 
> (6) ldap: EXPAND ou=%{request:Tmp-String-0},ou=People,dc=ulm,dc=edu
> (6) ldap:    --> ou=,ou=People,dc=ulm,dc=edu
> (6) ldap: Performing search in "ou=,ou=People,dc=ulm,dc=edu" with filter "(uid=pp)", scope "sub"
> 
> I went to verify that it was actually setting the variable and see this:
> 
> (6)       update request {
> (6)         Tmp-String-0 = "Students"
> (6)       } # update request = noop
> 
> I have tried every different way I can think of and it just will not set Tmp-String-0.  I have tried both = and := as well.  What am I doing wrong?

  Post the *full* debug output.  Let us figure it out.

  Alan DeKok.




More information about the Freeradius-Users mailing list