Freeradius 3.0 hints, rlm_perl

Thomas Glanzmann thomas at glanzmann.de
Sun Jul 21 23:57:09 CEST 2013


Hello Alan,

> I bleieve hitns is going the way of the dodo eventually - unlang can
> do the work for you eg

> if (%{User-Name} =~ "^v104\\\\([^@]+)" ) {
> 	update request {
> 		%{User-Name} := "%{1}@V104.GMVL.DE"
> 		}
> 	}

I tried:

server default {
        listen {
                type = auth
                ipaddr = *
        }


        authenticate {
                perl
        }

        authorize {
                update control {
                        Auth-Type := perl
                }
                if (%{User-Name} =~ /^v104\\\\([^@]+)/ ) {
                        update request {
                                %{User-Name} := "%{1}@V104.GMVL.DE"
                        }
                }
        }

        accounting {
                detail
        }

        post-auth {
                Post-Auth-Type REJECT {
                        attr_filter.access_reject
                }
        }
}

There was one error I could figure out the right side of the regular
expressions have to be // and not "", I fixed that but it does not
recognize the right hand side "%{1}@V104.GMVL.DE". Accordin to [1] it
should be that, if I understand it correctly. 

[1] http://freeradius.org/radiusd/man/unlang.html

> thats more interesting. We run PERL with 3.x here and havent seen such
> an issue.... wonder if your PERL environment is different....

I'm running Debian Wheezy. libperl-dev - 5.14.2-21

> it would be sooo much better for you to be running (or ready to run!)
> 3.x at this point in time

I work on it. :-)

Cheers,
        Thomas


More information about the Freeradius-Users mailing list