<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.StileMessaggioDiPostaElettronica18
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=IT link=blue vlink=purple>
<div class=Section1>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>Hi all,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>I’ve a strange problem
with sql counter on freeradius both 1.1.7 and 2.1.5 versions.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>Actually executing <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>SELECT SUM(AcctSessionTime)
FROM radacct WHERE UserName='mauro' <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>from SQL Server Management
Studio gives me 294841 (Yes, that's a lot of seconds, is a test user)<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>while the output of radiusd -X
(ver 2.1.5) is:<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>------------------------------------<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>rlm_sqlcounter: Entering module
authorize code<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>sqlcounter_expand:
'SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='%{<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>User-Name}''<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>[sessioncounter]
expand: SELECT SUM(AcctSessionTime) FROM radacct WHERE U<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>serName='%{User-Name}' ->
SELECT SUM(AcctSessionTime) FROM radacct WHERE UserNam<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>e='mauro'<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>sqlcounter_expand:
'%{sql:SELECT SUM(AcctSessionTime) FROM radacct WHERE UserNa<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>me='mauro'}'<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>[sessioncounter] sql_xlat<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>[sessioncounter]
expand: %{User-Name} -> mauro<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>[sessioncounter] sql_set_user
escaped user --> 'mauro'<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>[sessioncounter]
expand: SELECT SUM(AcctSessionTime) FROM radacct WHERE U<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>serName='mauro' -> SELECT
SUM(AcctSessionTime) FROM radacct WHERE UserName='maur<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>o'<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>[sessioncounter]
expand: /usr/var/log/radius/sqltrace.sql -> /usr/var/log<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>/radius/sqltrace.sql<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>rlm_sql (sql): Reserving sql
socket id: 3<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>query: SELECT
SUM(AcctSessionTime) FROM radacct WHERE UserName='mauro'<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>[sessioncounter] sql_xlat
finished<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>rlm_sql (sql): Released sql
socket id: 3<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>[sessioncounter]
expand: %{sql:SELECT SUM(AcctSessionTime) FROM radacct W<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>HERE UserName='mauro'} ->
2948<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>rlm_sqlcounter: Check item is
greater than query result<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>rlm_sqlcounter: Authorized user
mauro, check_item=3600, counter=2948<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>rlm_sqlcounter: Sent Reply-Item
for user mauro, Type=Session-Timeout, value=652<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>++[sessioncounter] returns ok<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>------------------------------------<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>That’s' totally wrong
since 294841 is much bigger than 3600 and not smaller... And this happens with
users from different groups and with different SUM(AcctSessionTime). *Every*
time SUM(AcctSessionTime) is bigger than 9999 it looses the fifth digit of the
response, better it looses every digits after the fourth!!!<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>What’s wrong??? I’d
appreciate any help or ideas. <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'>This happens on two different
Slackware 12.1 and 12.2 machines both with freeradius 1.1.7 and a Slackware
12.2 with freeradius 2.1.5<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
lang=EN-GB style='font-size:10.0pt;color:black'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt;color:black'>Mauro Iorio.<o:p></o:p></span></font></p>
</div>
</body>
</html>