config section in rlm_perl module

Chaigneau, Nicolas nicolas.chaigneau at capgemini.com
Tue Apr 21 09:52:55 CEST 2015



That's correct.

You cannot do this because %RAD_PERLCONF hash is only available in the context of a request.

Additionally, to use this hash you need to declare it in the perl script (this is not the case in the default example.pl provided).
(maybe it should ?)



For example:

# Bring the global hashes into the package scope
our (%RAD_REQUEST, %RAD_REPLY, %RAD_CONFIG, %RAD_PERLCONF);





> Hi,
> 
> I am not able to use %RAD_PERLCONF during parsing phase of radius.pm. I understand why, because section config (rlm_perl) is parsed after parsing radius.pm itself. Therefore i am able to set up global constant based on freeradius configuration.
> 
> Is it correct behaviour ?
> 
> Piece of radius.pm code:
> ...
> # Hashes with request / reply parameters use vars qw(%RAD_PERLCONF %RAD_REQUEST %RAD_REPLY %RAD_CHECK %RAD_REQUEST_PROXY %RAD_REQUEST_PROXY_REPLY);
> 
> use constant LOG_DIR => $RAD_PERLCONF{'logdir'}; (line 47) use constant LOG_FILENAME => LOG_DIR().$RAD_PERLCONF{'name'}.'.gen';
> use constant RADIUS_RADDB_DIR => $RAD_PERLCONF{'confdir'}; ...
> 
> Debug output (freeradius 3.0.7):
> ....
> radiusd: #### Instantiating modules ####  instantiate {
>   # Loaded module rlm_perl
>   # Instantiating module "perl" from file ./mods-enabled/perl
>   perl {
>   filename = "./mods-config/perl/radius.pm"
>   func_authorize = "authorize"
>   func_authenticate = "authenticate"
>   func_post_auth = "post_auth"
>   func_accounting = "accounting"
>   func_preacct = "preacct"
>   func_checksimul = "checksimul"
>   func_detach = "detach"
>   func_xlat = "xlat"
>   func_pre_proxy = "pre_proxy"
>   func_post_proxy = "post_proxy"
>   func_recv_coa = "recv_coa"
>   func_send_coa = "send_coa"
>   }
> Use of uninitialized value in concatenation (.) or string at ./mods-config/perl/radius.pm line 47, <DATA> line 751.
> rlm_perl (perl): parsing 'config' section...
>     config {
>         logdir = /app_log/radius/auth/
>         confdir = ./
>         name = auth
>     }
> rlm_perl (perl): done parsing 'config'.
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.



More information about the Freeradius-Users mailing list