Hello all, I have freeradias 1.0.5 installed with the rlm_perl module, and the trouble I'm having is that the user-name attribute is an empty string within the 'authenticate' routine I have for the perl script. My goal is to have the perl script handle the authentication, so this is obviously a problem. I'm guessing I have something misconfigured. Freeradius *definitely* runs the perl script, as you'll see from the debug info below. I have the perl script explicitely checking for an empty user-name string, and rejecting on that situation. Any hints would be much appreciated! In the .conf file, I have the following relevant sections: modules { perl{ module = /home/goose/radperl.pl func_authenticate = authenticate func_authorize = authorize } ... authorize { perl ... authenticate { perl And here is the debug from radiusd: rad_recv: Access-Request packet from host 127.0.0.1:33480, id=31, length=55 User-Name = "gus" User-Password = "123" NAS-IP-Address = 255.255.255.255 NAS-Port = 0 Processing the authorize section of radiusd.conf modcall: entering group authorize for request 0 perl_pool: item 0x9d35538 asigned new request. Handled so far: 1 found interpetator at address 0x9d35538 we did something with the perl module! perl_pool total/active/spare [5/0/5] Unreserve perl at address 0x9d35538 modcall[authorize]: module "perl" returns ok for request 0 modcall[authorize]: module "preprocess" returns ok for request 0 modcall[authorize]: module "chap" returns noop for request 0 modcall[authorize]: module "mschap" returns noop for request 0 rlm_realm: No '@' in User-Name = "gus", looking up realm NULL rlm_realm: No such realm "NULL" modcall[authorize]: module "suffix" returns noop for request 0 rlm_eap: No EAP-Message, not doing EAP modcall[authorize]: module "eap" returns noop for request 0 users: Matched entry gus at line 80 modcall[authorize]: module "files" returns ok for request 0 modcall: group authorize returns ok for request 0 rad_check_password: Found Auth-Type perl auth: type "perl" Processing the authenticate section of radiusd.conf modcall: entering group authenticate for request 0 perl_pool: item 0x9e8b308 asigned new request. Handled so far: 1 found interpetator at address 0x9e8b308 rlm_perl: Added pair Service-Type = Framed-User rlm_perl: Added pair Framed-Routing = Broadcast-Listen rlm_perl: Added pair Framed-Protocol = PPP rlm_perl: Added pair Framed-Filter-Id = std.ppp rlm_perl: Added pair Framed-IP-Address = 172.16.3.33 rlm_perl: Added pair Framed-IP-Netmask = 255.255.255.0 rlm_perl: Added pair Framed-Compression = Van-Jacobson-TCP-IP rlm_perl: Added pair Framed-MTU = 1500 rlm_perl: Added pair User-Password = 123 rlm_perl: Added pair Auth-Type = perl perl_pool total/active/spare [3/0/3] Unreserve perl at address 0x9e8b308 modcall[authenticate]: module "perl" returns reject for request 0 modcall: group authenticate returns reject for request 0 auth: Failed to validate the user. Delaying request 0 for 1 seconds Finished request 0 Going to the next request --- Walking the entire request list --- Waking up in 1 seconds... --- Walking the entire request list --- Waking up in 1 seconds... --- Walking the entire request list --- Sending Access-Reject of id 31 to 127.0.0.1:33480 Waking up in 4 seconds... --- Walking the entire request list --- Cleaning up request 0 ID 31 with timestamp 436d5cab Nothing to do. Sleeping until we see a request.
On Sunday 06 November 2005 02:35, Gustave Nylander wrote:
I have freeradias 1.0.5 installed with the rlm_perl module, and the trouble I'm having is that the user-name attribute is an empty string within the 'authenticate' routine I have for the perl script.
Please see in example.pl that comes with 1.0.5 there is a function log_request_attributes. Call this function right after you enter your authentuicate function, run radius in debug and send output. -- Best Regards, Boian Jordanov SNE Orbitel - Next Generation Telecom tel. +359 2 4004 723 tel. +359 2 4004 002
It looks like the %RAD_REQUEST hash is empty by the time you get to the authenticate function in the perl script. I've set up the log_request_attributes function for just standard output like thus: sub log_request_attributes { print "########### Request attributes debug ##############\n"; for (keys %RAD_REQUEST) { print "hello\n"; ... And in the debug output from the radiusd -X, you'll see this: auth: type "perl" Processing the authenticate section of radiusd.conf modcall: entering group authenticate for request 0 perl_pool: item 0x9413670 asigned new request. Handled so far: 1 found interpetator at address 0x9413670 ########### Request attributes debug ############## rlm_perl: Added pair Service-Type = Framed-User rlm_perl: Added pair Framed-Routing = Broadcast-Listen rlm_perl: Added pair Framed-Protocol = PPP ... You can see that we never get a 'hello', because it nevers enters the for loop in the log function since %RAD_REQUEST is empty. I'm not sure what I've done to make it disappear. Thanks for the response! Boyan Jordanov wrote:
On Sunday 06 November 2005 02:35, Gustave Nylander wrote:
I have freeradias 1.0.5 installed with the rlm_perl module, and the trouble I'm having is that the user-name attribute is an empty string within the 'authenticate' routine I have for the perl script.
Please see in example.pl that comes with 1.0.5 there is a function log_request_attributes. Call this function right after you enter your authentuicate function, run radius in debug and send output.
On Monday 07 November 2005 16:31, Gustave Nylander wrote:
You can see that we never get a 'hello', because it nevers enters the for loop in the log function since %RAD_REQUEST is empty.
I'm not sure what I've done to make it disappear. Thanks for the response!
Try it again with example.pl -- Best Regards, Boian Jordanov SNE Orbitel - Next Generation Telecom tel. +359 2 4004 723 tel. +359 2 4004 002
participants (2)
-
Boyan Jordanov -
Gustave Nylander