hi again... i try to get suffix work but i guess missing something... here some debugs and confs<div><br></div><div><div>rad_recv: Access-Request packet from host 10.10.64.67 port 16829, id=53, length=208</div><div> Framed-Protocol = PPP</div>
<div> User-Name = "<b><a href="mailto:usertest@my.domain.cu">usertest@my.domain.cu</a></b>"</div><div> User-Password = "<b>secret</b>"</div><div> NAS-Port-Type = Async</div><div> Calling-Station-Id = "123456789"</div>
<div> Called-Station-Id = "987654321"</div><div> Connect-Info = "44000/28800 V90/V44/LAPM"</div><div> Cisco-AVPair = "v92-info=V.92 QC/QC Short Train Success/0/0"</div><div>
NAS-Port = 443</div><div> NAS-Port-Id = "Async3/11*E1 7/0:7"</div><div> Service-Type = Framed-User</div><div> NAS-IP-Address = 10.10.64.67</div><div># Executing section authorize from file /etc/freeradius/sites-available/default</div>
<div>+- entering group authorize {...}</div><div>[preprocess] hints: Matched DEFAULT at 36</div><div>++[preprocess] returns ok</div><div>++- entering policy filter_username {...}</div><div>+++? if (User-Name =~ /^ /)</div>
<div>? Evaluating (User-Name =~ /^ /) -> FALSE</div><div>+++? if (User-Name =~ /^ /) -> FALSE</div><div>+++? if (User-Name =~ / $$/)</div><div>? Evaluating (User-Name =~ / $$/) -> FALSE</div><div>+++? if (User-Name =~ / $$/) -> FALSE</div>
<div>+++? if (User-Name != "%{tolower:%{User-Name}}")</div><div> expand: %{User-Name} -> <b><a href="mailto:usertest@my.domain.cu">usertest@my.domain.cu</a></b></div><div> expand: %{tolower:%{User-Name}} -> <b><a href="mailto:usertest@my.domain.cu">usertest@my.domain.cu</a></b> </div>
<div>? Evaluating (User-Name != "%{tolower:%{User-Name}}") -> FALSE</div><div>+++? if (User-Name != "%{tolower:%{User-Name}}") -> FALSE</div><div>++- policy filter_username returns ok</div><div>
<b>[suffix] No '@' in User-Name = "usertest", looking up realm NULL <---why not found '@' if is coming in radius packet and check in the conf???</b></div>
<div>[suffix] No such realm "NULL"</div><div>++[suffix] returns noop</div><div>[ldap] performing user authorization for <b>usertest</b></div><div>[ldap] expand: %{Stripped-User-Name} -> <b>usertest</b></div>
<div>[ldap] expand: (uid=%{%{Stripped-User-Name}:-%{User-Name}}) -> (uid=<b>usertest</b>) <b><---------- this works stripped-user-name OK</b></div><div>[ldap] expand: ou=group,ou=my,dc=domain,dc=cu -> ou=group,ou=my,dc=domain,dc=cu</div>
<div>.</div><div><b>checking user/pass works fine... now check monthlycounter to compare hours..</b></div><div>.</div><div><div>[monthlycounter1] sql_xlat</div><div>[monthlycounter1] WARNING: Deprecated conditional expansion ":-". See "man unlang" for details</div>
<div>[monthlycounter1] expand: %{Stripped-User-Name:-%{User-Name:-DEFAULT}} -> <b>usertest</b></div><div>[monthlycounter1] sql_set_user escaped user --> '<b>usertest</b>'</div><div><br></div><div><b>IF stripped-user-name works here at monthlycounter why the query not use it! and use user with realm??/</b></div>
<div><br></div><div>[monthlycounter1] expand: SELECT SUM(acctsessiontime - GREATEST((1346472000 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username='<b><a href="mailto:usertest@my.domain.cu">usertest@my.domain.cu</a></b>' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1346472000' -> SELECT SUM(acctsessiontime - GREATEST((1346472000 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username='<b><a href="mailto:usertest@my.domain.cu">usertest@my.domain.cu</a></b>' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1346472000'</div>
<div>rlm_sql (sql1): Reserving sql socket id: 4</div><div>[monthlycounter1] row[0] returned NULL</div><div>rlm_sql (sql1): Released sql socket id: 4</div><div>[monthlycounter1] expand: %{sql1:SELECT SUM(acctsessiontime - GREATEST((1346472000 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username='<b><a href="mailto:usertest@my.domain.cu">usertest@my.domain.cu</a></b>' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1346472000'} -> </div>
<div><b>rlm_sqlcounter: No integer found in string "" <------------- must be found integer to compare with max-monthly-session, in database i have only usernames, not with realms</b></div><div>+++[monthlycounter1] returns noop</div>
</div><div><br></div><div>hints confs</div><div><div><br></div><div><b>DEFAULT Suffix == "@<a href="http://my.domain.cu">my.domain.cu</a>", Strip-User-Name = Yes</b></div><div> Hint = "userdefault",</div>
<div> Service-Type = Framed-User,</div><div> Framed-Protocol = PPP,</div></div><div><br></div><div>site-available/default</div><div><br></div><div><div># cat sites-available/default | egrep -v '\#|^$'</div>
<div>authorize {</div><div> preprocess</div><div> filter_username</div><div> <b>suffix</b></div><div> ldap</div><div> redundant-load-balance {</div><div> monthlycounter1</div>
<div> monthlycounter2</div><div> }</div><div> checkval1</div><div> checkval2</div><div> checkval3</div><div><br></div><div> expiration</div><div> logintime</div><div>
pap</div><div>}</div><div>authenticate {</div><div> Auth-Type PAP {</div><div> pap</div><div> }</div><div> Auth-Type LDAP {</div><div> ldap</div><div> }</div>
<div>}</div><div>preacct {</div><div> preprocess</div><div> acct_unique</div><div> <b>suffix</b></div><div>}</div><div>accounting {</div><div> redundant-load-balance {</div><div> sql1</div>
<div> sql2</div><div> }</div><div>}</div><div>session {</div><div> load-balance {</div><div> sql1</div><div> sql2</div><div> }</div><div>}</div><div>post-auth {</div>
<div> Post-Auth-Type REJECT {</div><div> attr_filter.access_reject</div><div> }</div><div>}</div><div>pre-proxy {</div><div>}</div><div>post-proxy {</div><div>}</div></div><div><br></div><div>
<br></div><div>thanxs for any help.</div><div><br></div>-- <br><font color="#888888"><font color="#888888">Antonio Pe</font><span><font color="#888888">ñ</font></span><font color="#888888">a</font><span></span><br><font color="#888888">Secure email with PGP 0x8B021001 available at <a href="http://pgp.mit.edu" target="_blank">http://pgp.mit.edu</a><br>
</font></font><font color="#888888">
<font color="#888888">Fingerprint: 74E6 2974 B090 366D CE71 7BB2 6476 FA09 8B02 1001</font></font><br>
</div>