unlang and optimization
A.L.M.Buxey at lboro.ac.uk
A.L.M.Buxey at lboro.ac.uk
Thu Apr 25 23:37:58 CEST 2013
Hi,
> I'm looking for some information on optimizing some of the
> configuration I've made in my freeradius 2.2.0 installation.
> Specifically, I need to set a variable based on the LDAP Group
> membership of a user. I'm doing this in the post-auth section at the
> moment, which I think is correct. The syntax I'm using is as follows :
>
> if (LDAP-Group == "cn=violations,ou=groups,o=mycorp") {
> update request {
> Tmp-String-0 := "VIOLATORS"
> }
> }
> elsif (LDAP-Group == "cn=guests,ou=groups,o=mycorp") {
> update request {
> Tmp-String-0 := "GUEST"
> }
> }
are they your only groups? if so, one less call is a quick optimisation
if (LDAP-Group == "cn=violations,ou=groups,o=mycorp") {
update request {
Tmp-String-0 := "VIOLATORS"
}
}
else {
update request {
Tmp-String-0 := "GUEST"
}
}
you could make a call to python or PERL which could have funky LDAP
to pull back all the detail and then set the Tmp-String-0 to be what you
need it to be....or wait for FR 3.x which has a few new tricks up its sleeve
alan
More information about the Freeradius-Users
mailing list