<div>here' my debug output. All i wanted to do is to use perl to authorize. perl will then interact with the database. during the requests, i wanted to cache the clients info, instead of writing it to the database since it is short lived. the client will make many authorize requests, and the cached info is supposed to be available to the client.</div>

<div> </div>
<div><span lang="EN">
<p>FreeRADIUS Version 2.1.9, for host x86_64-unknown-linux-gnu, built on Jun 21 2010 at 13:51:58</p>
<p>Copyright (C) 1999-2009 The FreeRADIUS server project and contributors. </p>
<p>There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A </p>
<p>PARTICULAR PURPOSE. </p>
<p>You may redistribute copies of FreeRADIUS under the terms of the </p>
<p>GNU General Public License v2. </p>
<p>Starting - reading configuration files ...</p>
<p>including configuration file /usr/local/etc/raddb/radiusd.conf</p>
<p>including configuration file /usr/local/etc/raddb/proxy.conf</p>
<p>including configuration file /usr/local/etc/raddb/clients.conf</p>
<p>including files in directory /usr/local/etc/raddb/modules/</p>
<p>including configuration file /usr/local/etc/raddb/modules/ntlm_auth</p>
<p>including configuration file /usr/local/etc/raddb/modules/radutmp</p>
<p>including configuration file /usr/local/etc/raddb/modules/chap</p>
<p>including configuration file /usr/local/etc/raddb/modules/attr_filter</p>
<p>including configuration file /usr/local/etc/raddb/modules/detail</p>
<p>including configuration file /usr/local/etc/raddb/modules/checkval</p>
<p>including configuration file /usr/local/etc/raddb/modules/mac2ip</p>
<p>including configuration file /usr/local/etc/raddb/modules/attr_rewrite</p>
<p>including configuration file /usr/local/etc/raddb/modules/preprocess</p>
<p>including configuration file /usr/local/etc/raddb/modules/pap</p>
<p>including configuration file /usr/local/etc/raddb/modules/smsotp</p>
<p>including configuration file /usr/local/etc/raddb/modules/echo</p>
<p>including configuration file /usr/local/etc/raddb/modules/cui</p>
<p>including configuration file /usr/local/etc/raddb/modules/realm</p>
<p>including configuration file /usr/local/etc/raddb/modules/linelog</p>
<p>including configuration file /usr/local/etc/raddb/modules/perl</p>
<p>including configuration file /usr/local/etc/raddb/modules/always</p>
<p>including configuration file /usr/local/etc/raddb/modules/digest</p>
<p>including configuration file /usr/local/etc/raddb/modules/mschap</p>
<p>including configuration file /usr/local/etc/raddb/modules/files</p>
<p>including configuration file /usr/local/etc/raddb/modules/otp</p>
<p>including configuration file /usr/local/etc/raddb/modules/inner-eap</p>
<p>including configuration file /usr/local/etc/raddb/modules/ippool</p>
<p>including configuration file /usr/local/etc/raddb/modules/passwd</p>
<p>including configuration file /usr/local/etc/raddb/modules/policy</p>
<p>including configuration file /usr/local/etc/raddb/modules/wimax</p>
<p>including configuration file /usr/local/etc/raddb/modules/sradutmp</p>
<p>including configuration file /usr/local/etc/raddb/modules/counter</p>
<p>including configuration file /usr/local/etc/raddb/modules/exec</p>
<p>including configuration file /usr/local/etc/raddb/modules/detail.log</p>
<p>including configuration file /usr/local/etc/raddb/modules/logintime</p>
<p>including configuration file /usr/local/etc/raddb/modules/etc_group</p>
<p>including configuration file /usr/local/etc/raddb/modules/smbpasswd</p>
<p>including configuration file /usr/local/etc/raddb/modules/pam</p>
<p>including configuration file /usr/local/etc/raddb/modules/acct_unique</p>
<p>including configuration file /usr/local/etc/raddb/modules/sqlcounter_expire_on_login</p>
<p>including configuration file /usr/local/etc/raddb/modules/expiration</p>
<p>including configuration file /usr/local/etc/raddb/modules/unix</p>
<p>including configuration file /usr/local/etc/raddb/modules/mac2vlan</p>
<p>including configuration file /usr/local/etc/raddb/modules/<a href="http://detail.example.com">detail.example.com</a></p>
<p>including configuration file /usr/local/etc/raddb/modules/krb5</p>
<p>including configuration file /usr/local/etc/raddb/modules/ldap</p>
<p>including configuration file /usr/local/etc/raddb/modules/expr</p>
<p>including configuration file /usr/local/etc/raddb/modules/sql_log</p>
<p>including configuration file /usr/local/etc/raddb/eap.conf</p>
<p>including configuration file /usr/local/etc/raddb/policy.conf</p>
<p>including files in directory /usr/local/etc/raddb/sites-enabled/</p>
<p>including configuration file /usr/local/etc/raddb/sites-enabled/control-socket</p>
<p>including configuration file /usr/local/etc/raddb/sites-enabled/default</p>
<p>including configuration file /usr/local/etc/raddb/sites-enabled/inner-tunnel</p>
<p>main {</p>
<p>allow_core_dumps = no</p>
<p>}</p>
<p>including dictionary file /usr/local/etc/raddb/dictionary</p>
<p>main {</p>
<p>prefix = "/usr/local"</p>
<p>localstatedir = "/usr/local/var"</p>
<p>logdir = "/usr/local/var/log/radius"</p>
<p>libdir = "/usr/local/lib"</p>
<p>radacctdir = "/usr/local/var/log/radius/radacct"</p>
<p>hostname_lookups = no</p>
<p>max_request_time = 30</p>
<p>cleanup_delay = 5</p>
<p>max_requests = 1024</p>
<p>pidfile = "/usr/local/var/run/radiusd/radiusd.pid"</p>
<p>checkrad = "/usr/local/sbin/checkrad"</p>
<p>debug_level = 0</p>
<p>proxy_requests = yes</p>
<p>log {</p>
<p>stripped_names = no</p>
<p>auth = no</p>
<p>auth_badpass = no</p>
<p>auth_goodpass = no</p>
<p>}</p>
<p>security {</p>
<p>max_attributes = 200</p>
<p>reject_delay = 1</p>
<p>status_server = yes</p>
<p>}</p>
<p>}</p>
<p>radiusd: #### Loading Realms and Home Servers ####</p>
<p>proxy server {</p>
<p>retry_delay = 5</p>
<p>retry_count = 3</p>
<p>default_fallback = no</p>
<p>dead_time = 120</p>
<p>wake_all_if_all_dead = no</p>
<p>}</p>
<p>home_server localhost {</p>
<p>ipaddr = 127.0.0.1</p>
<p>port = 1812</p>
<p>type = "auth"</p>
<p>secret = "testing123"</p>
<p>response_window = 20</p>
<p>max_outstanding = 65536</p>
<p>require_message_authenticator = no</p>
<p>zombie_period = 40</p>
<p>status_check = "status-server"</p>
<p>ping_interval = 30</p>
<p>check_interval = 30</p>
<p>num_answers_to_alive = 3</p>
<p>num_pings_to_alive = 3</p>
<p>revive_interval = 120</p>
<p>status_check_timeout = 4</p>
<p>irt = 2</p>
<p>mrt = 16</p>
<p>mrc = 5</p>
<p>mrd = 30</p>
<p>}</p>
<p>home_server_pool my_auth_failover {</p>
<p>type = fail-over</p>
<p>home_server = localhost</p>
<p>}</p>
<p>realm <a href="http://example.com">example.com</a> {</p>
<p>auth_pool = my_auth_failover</p>
<p>}</p>
<p>realm LOCAL {</p>
<p>}</p>
<p>radiusd: #### Loading Clients ####</p>
<p>client localhost {</p>
<p>ipaddr = 127.0.0.1</p>
<p>require_message_authenticator = no</p>
<p>secret = "testing123"</p>
<p>nastype = "other"</p>
<p>}</p>
<p>client GW {</p>
<p>ipaddr = 192.168.1.6</p>
<p>require_message_authenticator = no</p>
<p>secret = "testing123"</p>
<p>nastype = "cisco"</p>
<p>}</p>
<p>client test {</p>
<p>ipaddr = 98.194.9.20</p>
<p>require_message_authenticator = no</p>
<p>secret = "testing123"</p>
<p>nastype = "other"</p>
<p>}</p>
<p>radiusd: #### Instantiating modules ####</p>
<p>instantiate {</p>
<p>Module: Linked to module rlm_exec</p>
<p>Module: Instantiating exec</p>
<p>exec {</p>
<p>wait = no</p>
<p>input_pairs = "request"</p>
<p>shell_escape = yes</p>
<p>}</p>
<p>Module: Linked to module rlm_expr</p>
<p>Module: Instantiating expr</p>
<p>Module: Linked to module rlm_expiration</p>
<p>Module: Instantiating expiration</p>
<p>expiration {</p>
<p>reply-message = "Password Has Expired "</p>
<p>}</p>
<p>Module: Linked to module rlm_logintime</p>
<p>Module: Instantiating logintime</p>
<p>logintime {</p>
<p>reply-message = "You are calling outside your allowed timespan "</p>
<p>minimum-timeout = 60</p>
<p>}</p>
<p>}</p>
<p>radiusd: #### Loading Virtual Servers ####</p>
<p>server inner-tunnel {</p>
<p>modules {</p>
<p>Module: Checking authenticate {...} for more modules to load</p>
<p>Module: Linked to module rlm_pap</p>
<p>Module: Instantiating pap</p>
<p>pap {</p>
<p>encryption_scheme = "auto"</p>
<p>auto_header = no</p>
<p>}</p>
<p>Module: Linked to module rlm_chap</p>
<p>Module: Instantiating chap</p>
<p>Module: Linked to module rlm_mschap</p>
<p>Module: Instantiating mschap</p>
<p>mschap {</p>
<p>use_mppe = yes</p>
<p>require_encryption = no</p>
<p>require_strong = no</p>
<p>with_ntdomain_hack = no</p>
<p>}</p>
<p>Module: Linked to module rlm_unix</p>
<p>Module: Instantiating unix</p>
<p>unix {</p>
<p>radwtmp = "/usr/local/var/log/radius/radwtmp"</p>
<p>}</p>
<p>Module: Linked to module rlm_eap</p>
<p>Module: Instantiating eap</p>
<p>eap {</p>
<p>default_eap_type = "md5"</p>
<p>timer_expire = 60</p>
<p>ignore_unknown_eap_types = no</p>
<p>cisco_accounting_username_bug = no</p>
<p>max_sessions = 4096</p>
<p>}</p>
<p>Module: Linked to sub-module rlm_eap_md5</p>
<p>Module: Instantiating eap-md5</p>
<p>Module: Linked to sub-module rlm_eap_leap</p>
<p>Module: Instantiating eap-leap</p>
<p>Module: Linked to sub-module rlm_eap_gtc</p>
<p>Module: Instantiating eap-gtc</p>
<p>gtc {</p>
<p>challenge = "Password: "</p>
<p>auth_type = "PAP"</p>
<p>}</p>
<p>Module: Linked to sub-module rlm_eap_tls</p>
<p>Module: Instantiating eap-tls</p>
<p>tls {</p>
<p>rsa_key_exchange = no</p>
<p>dh_key_exchange = yes</p>
<p>rsa_key_length = 512</p>
<p>dh_key_length = 512</p>
<p>verify_depth = 0</p>
<p>pem_file_type = yes</p>
<p>private_key_file = "/usr/local/etc/raddb/certs/server.pem"</p>
<p>certificate_file = "/usr/local/etc/raddb/certs/server.pem"</p>
<p>CA_file = "/usr/local/etc/raddb/certs/ca.pem"</p>
<p>private_key_password = "whatever"</p>
<p>dh_file = "/usr/local/etc/raddb/certs/dh"</p>
<p>random_file = "/usr/local/etc/raddb/certs/random"</p>
<p>fragment_size = 1024</p>
<p>include_length = yes</p>
<p>check_crl = no</p>
<p>cipher_list = "DEFAULT"</p>
<p>make_cert_command = "/usr/local/etc/raddb/certs/bootstrap"</p>
<p>cache {</p>
<p>enable = no</p>
<p>lifetime = 24</p>
<p>max_entries = 255</p>
<p>}</p>
<p>}</p>
<p>Module: Linked to sub-module rlm_eap_ttls</p>
<p>Module: Instantiating eap-ttls</p>
<p>ttls {</p>
<p>default_eap_type = "md5"</p>
<p>copy_request_to_tunnel = no</p>
<p>use_tunneled_reply = no</p>
<p>virtual_server = "inner-tunnel"</p>
<p>include_length = yes</p>
<p>}</p>
<p>Module: Linked to sub-module rlm_eap_peap</p>
<p>Module: Instantiating eap-peap</p>
<p>peap {</p>
<p>default_eap_type = "mschapv2"</p>
<p>copy_request_to_tunnel = no</p>
<p>use_tunneled_reply = no</p>
<p>proxy_tunneled_request_as_eap = yes</p>
<p>virtual_server = "inner-tunnel"</p>
<p>}</p>
<p>Module: Linked to sub-module rlm_eap_mschapv2</p>
<p>Module: Instantiating eap-mschapv2</p>
<p>mschapv2 {</p>
<p>with_ntdomain_hack = no</p>
<p>}</p>
<p>Module: Checking authorize {...} for more modules to load</p>
<p>Module: Linked to module rlm_realm</p>
<p>Module: Instantiating suffix</p>
<p>realm suffix {</p>
<p>format = "suffix"</p>
<p>delimiter = "@"</p>
<p>ignore_default = no</p>
<p>ignore_null = no</p>
<p>}</p>
<p>Module: Linked to module rlm_files</p>
<p>Module: Instantiating files</p>
<p>files {</p>
<p>usersfile = "/usr/local/etc/raddb/users"</p>
<p>acctusersfile = "/usr/local/etc/raddb/acct_users"</p>
<p>preproxy_usersfile = "/usr/local/etc/raddb/preproxy_users"</p>
<p>compat = "no"</p>
<p>}</p>
<p>Module: Checking session {...} for more modules to load</p>
<p>Module: Linked to module rlm_radutmp</p>
<p>Module: Instantiating radutmp</p>
<p>radutmp {</p>
<p>filename = "/usr/local/var/log/radius/radutmp"</p>
<p>username = "%{User-Name}"</p>
<p>case_sensitive = yes</p>
<p>check_with_nas = yes</p>
<p>perm = 384</p>
<p>callerid = yes</p>
<p>}</p>
<p>Module: Checking post-proxy {...} for more modules to load</p>
<p>Module: Checking post-auth {...} for more modules to load</p>
<p>Module: Linked to module rlm_attr_filter</p>
<p>Module: Instantiating attr_filter.access_reject</p>
<p>attr_filter attr_filter.access_reject {</p>
<p>attrsfile = "/usr/local/etc/raddb/attrs.access_reject"</p>
<p>key = "%{User-Name}"</p>
<p>}</p>
<p>} # modules</p>
<p>} # server</p>
<p>server {</p>
<p>modules {</p>
<p>Module: Checking authenticate {...} for more modules to load</p>
<p>Module: Linked to module rlm_perl</p>
<p>Module: Instantiating perl</p>
<p>perl {</p>
<p>module = "/usr/local/etc/raddb/<a href="http://example.pl">example.pl</a>"</p>
<p>func_authorize = "authorize"</p>
<p>func_authenticate = "authenticate"</p>
<p>func_accounting = "accounting"</p>
<p>func_preacct = "preacct"</p>
<p>func_checksimul = "checksimul"</p>
<p>func_detach = "detach"</p>
<p>func_xlat = "xlat"</p>
<p>func_pre_proxy = "pre_proxy"</p>
<p>func_post_proxy = "post_proxy"</p>
<p>func_post_auth = "post_auth"</p>
<p>func_recv_coa = "recv_coa"</p>
<p>func_send_coa = "send_coa"</p>
<p>}</p>
<p>Module: Checking authorize {...} for more modules to load</p>
<p>Module: Linked to module rlm_preprocess</p>
<p>Module: Instantiating preprocess</p>
<p>preprocess {</p>
<p>huntgroups = "/usr/local/etc/raddb/huntgroups"</p>
<p>hints = "/usr/local/etc/raddb/hints"</p>
<p>with_ascend_hack = no</p>
<p>ascend_channels_per_line = 23</p>
<p>with_ntdomain_hack = no</p>
<p>with_specialix_jetstream_hack = no</p>
<p>with_cisco_vsa_hack = no</p>
<p>with_alvarion_vsa_hack = no</p>
<p>}</p>
<p>Module: Checking preacct {...} for more modules to load</p>
<p>Module: Linked to module rlm_acct_unique</p>
<p>Module: Instantiating acct_unique</p>
<p>acct_unique {</p>
<p>key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port"</p>
<p>}</p>
<p>Module: Checking accounting {...} for more modules to load</p>
<p>Module: Linked to module rlm_detail</p>
<p>Module: Instantiating detail</p>
<p>detail {</p>
<p>detailfile = "/usr/local/var/log/radius/radacct/%{Client-IP-Address}/detail-%Y%m%d"</p>
<p>header = "%t"</p>
<p>detailperm = 384</p>
<p>dirperm = 493</p>
<p>locking = no</p>
<p>log_packet_header = no</p>
<p>}</p>
<p>Module: Instantiating attr_filter.accounting_response</p>
<p>attr_filter attr_filter.accounting_response {</p>
<p>attrsfile = "/usr/local/etc/raddb/attrs.accounting_response"</p>
<p>key = "%{User-Name}"</p>
<p>}</p>
<p>Module: Checking session {...} for more modules to load</p>
<p>Module: Checking post-proxy {...} for more modules to load</p>
<p>Module: Checking post-auth {...} for more modules to load</p>
<p>} # modules</p>
<p>} # server</p>
<p>radiusd: #### Opening IP addresses and Ports ####</p>
<p>listen {</p>
<p>type = "auth"</p>
<p>ipaddr = *</p>
<p>port = 0</p>
<p>Failed binding to authentication address * port 1812: Address already in use </p>
<p>/usr/local/etc/raddb/radiusd.conf[240]: Error binding to port for 0.0.0.0 port 1812</p></span><br><br></div>
<div class="gmail_quote">On Tue, Mar 1, 2011 at 3:00 AM, Alexander Clouter <span dir="ltr"><<a href="mailto:alex@digriz.org.uk">alex@digriz.org.uk</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hi,<br>
<div class="im"><br>* Vinh Nguyen <<a href="mailto:vhn2000@gmail.com">vhn2000@gmail.com</a>> [2011-03-01 00:37:17-0600]:<br>><br></div>
<div class="im">> something is very strange in my case.<br>><br>> I used the global variable like you pointed out. Then I tested the logic and<br>> it seems like the hash variable isn't cache properly. The data is not<br>
> cached. I gave up and tried again in couple hours. And then it magically<br>> worked. now the hash variable is caching the data as expected. But I'm a bit<br>> confused as why it wasn't working in the first place.<br>
><br></div>Looks like Alan has just updated the Perl example:<br><br><a href="https://github.com/alandekok/freeradius-server/blob/master/src/modules/rlm_perl/example.pl" target="_blank">https://github.com/alandekok/freeradius-server/blob/master/src/modules/rlm_perl/example.pl</a><br>
<br>Looking at what is going on, I think there might be some indirect<br>'BEGIN' abuse that causes this to work.  I spoke to my 'goto' Perl<br>friend and he suggested that the following is the way to probably do<br>
this:<br>----<br>our %static_hash;<br>----<br><br>From my mod_perl experiences, that does sound/feel familiar.<br><br>Anyway, in my example just does caching for an EAP session between the<br>first call through authorize{} and the final post-auth{} call; which<br>
probably explains why it works for me.<br><br>Cheers<br><font color="#888888"><br>--<br>Alexander Clouter<br>.sigmonster says: BOFH excuse #10:<br>                 hardware stress fractures<br></font></blockquote></div><br>
<br clear="all"><br>-- <br>Computer Science B.S. at Texas A&M<br>C# .Net Developer<br>Server Analyst.<br>