rlm_perl error
Bjørn Mork
bjorn at mork.no
Wed Aug 25 14:19:58 CEST 2010
"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
More information about the Freeradius-Users
mailing list