rlm_perl error

JUND, Aurélien aurelien.jund at sfr.com
Fri Aug 27 12:40:20 CEST 2010


I get this error when I run freeradius using this piece of code in my example.pl: 



Can't modify constant item in scalar assignment at /etc/freeradius_commu/example.pl line 60, near "NULL;"
Execution of /etc/freeradius_commu/example.pl aborted due to compilation errors.
rlm_perl: perl_parse failed: /etc/freeradius_commu/example.pl not found or has syntax errors.
/etc/freeradius_commu/modules/perl[7]: Instantiation failed for module "perl"
/etc/freeradius_commu/sites-enabled/sfrwificommu[9]: Failed to find module "perl".
/etc/freeradius_commu/sites-enabled/sfrwificommu[5]: Errors parsing authorize section.

-----Message d'origine-----
De : freeradius-users-bounces+aurelien.jund=sfr.com at lists.freeradius.org [mailto:freeradius-users-bounces+aurelien.jund=sfr.com at lists.freeradius.org] De la part de Bjørn Mork
Envoyé : mercredi 25 août 2010 14:20
À : FreeRadius users mailing list
Objet : Re: rlm_perl error

"JUND, Aurélien" <aurelien.jund at sfr.com> writes:

> 3 hashes are given to the module and  filled with value-pairs (Attribute names and values):
>
>         #  %RAD_CHECK           Read-only       Check items
>         #  %RAD_REQUEST         Read-only       Attributes from the request
>         #  %RAD_REPLY           Read-write      Attributes for the reply
>
> Why are %RAD_CHECK            and %RAD_REQUEST Read-Only? 

I believe this is wrong. rlm_perl copies data back from all 5 hashes
(RAD_REQUEST, RAD_REPLY, RAD_CHECK, RAD_REQUEST_PROXY, RAD_REQUEST_PROXY_REPLY):


        if ((get_hv_content(rad_request_hv, &vp)) > 0 ) {
                pairfree(&request->packet->vps);
                request->packet->vps = vp;
                vp = NULL;

                /*
                 *      Update cached copies
                 */
                request->username = pairfind(request->packet->vps,
                                             PW_USER_NAME);
                request->password = pairfind(request->packet->vps,
                                             PW_USER_PASSWORD);
                if (!request->password)
                        request->password = pairfind(request->packet->vps,
                                                     PW_CHAP_PASSWORD);
        }

        if ((get_hv_content(rad_reply_hv, &vp)) > 0 ) {
                pairfree(&request->reply->vps);
                request->reply->vps = vp;
                vp = NULL;
        }

        if ((get_hv_content(rad_check_hv, &vp)) > 0 ) {
                pairfree(&request->config_items);
                request->config_items = vp;
                vp = NULL;
        }

        if (request->proxy &&
            (get_hv_content(rad_request_proxy_hv, &vp) > 0)) {
                pairfree(&request->proxy->vps);
                request->proxy->vps = vp;
                vp = NULL;
        }

        if (request->proxy_reply &&
            (get_hv_content(rad_request_proxy_reply_hv, &vp) > 0)) {
                pairfree(&request->proxy_reply->vps);
                request->proxy_reply->vps = vp;
                vp = NULL;
        }





> I would like to add check item and modify le request. Is there a way
> to make them Read-write?

Try it and see if it works.


Bjørn

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html




More information about the Freeradius-Users mailing list