<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PersonName" downloadurl="http://www.microsoft.com"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<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:Arial;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 107.65pt 2.0cm 107.65pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=IT link=blue vlink=purple>
<div class=Section1>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>Thank you Alan for your reply.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>As written by Paolo, we simply added a query (</span></font><span
lang=EN-GB>postauth_mac_query) to sql.conf file that gives back user’s MAC
address:<o:p></o:p></span></p>
<p class=MsoPlainText style='text-indent:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt'>...........<o:p></o:p></span></font></p>
<p class=MsoPlainText style='text-indent:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt'>...........<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'> </span></font><span lang=EN-GB>postauth_query
= "INSERT into ${postauth_table} (id, user, pass,<o:p></o:p></span></p>
<p class=MsoPlainText style='text-indent:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt'>reply, date) values ('', '%{User-Name}',
'%{User-Password:-Chap-Password}',<o:p></o:p></span></font></p>
<p class=MsoPlainText style='text-indent:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt'>'%{reply:Packet-Type}', NOW())"<o:p></o:p></span></font></p>
<p class=MsoPlainText style='text-indent:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText style='text-indent:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt'>postauth_mac_query = "INSERT into
${authcheck_table} (UserName,<o:p></o:p></span></font></p>
<p class=MsoPlainText style='text-indent:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt'>Attribute, op, Value) VALUES
('%{SQL-User-Name}'', 'Calling-Station-Id',<o:p></o:p></span></font></p>
<p class=MsoPlainText style='text-indent:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt'>':=', '%{Calling-Station-Id}')"<o:p></o:p></span></font></p>
<p class=MsoPlainText style='text-indent:35.4pt'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>The query was build on the model of the </span></font><span
lang=EN-GB>postauth_query one, so no problems should arise about its syntax. In
fact, if we change the content of postauth_query with the one of post_mac_query,
it works fine (MAC address is inserted into radcheck table).<o:p></o:p></span></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>The problem is that it seems that freeRADIUS does not
recognize the new defined query (postauth_mac_query) in fact, looking at debug
output, we can see calls to all other queries but not to the new one.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>So the question is: how let freeRADIUS understand when
to call each single query defined into sql.conf file?<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>Any advice?<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>Regadrs,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'>Carlo<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'> <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>-----Messaggio
originale-----<br>
Da: freeradius-users-bounces+c.prestopino=waitalia.com@lists.freeradius.org
[mailto:freeradius-users-bounces+c.prestopino=waitalia.com@lists.freeradius.org]
Per conto di <st1:PersonName ProductID="Paolo Pellicori" w:st="on">Paolo
Pellicori</st1:PersonName><br>
Inviato: venerdì 27 gennaio 2006 10.12<br>
A: '<st1:PersonName w:st="on">FreeRadius users mailing list</st1:PersonName>'<br>
Oggetto: R: R: SQL.conf new query </span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>I
have append the query to the existing ones, but without it turns out to<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>you.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>
postauth_mac_query = "INSERT into ${authcheck_table} (UserName,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>Attribute,
op, Value) VALUES ('%{SQL-User-Name}'', 'Calling-Station-Id',<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>':=',
'%{Calling-Station-Id}')"<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'> postauth_query
= "INSERT into ${postauth_table} (id, user, pass,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>reply,
date) values ('', '%{User-Name}', '%{User-Password:-Chap-Password}',<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>'%{reply:Packet-Type}',
NOW())"<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>in
the log of start you come only loaded the postauth_query:<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>sql:
group_membership_query = "SELECT GroupName FROM usergroup WHERE<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>UserName='%{SQL-User-Name}'"<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'> sql:
connect_failure_retry_delay = 60<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'> sql:
simul_count_query = ""<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'> sql:
simul_verify_query = "SELECT RadAcctId, AcctSessionId, UserName,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>NASIPAddress,
NASPortId, FramedIPAddress, CallingStationId, FramedProtocol<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>FROM
radacct WHERE UserName='%{SQL-User-Name}' AND AcctStopTime = 0"<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'> sql:
postauth_table = "radpostauth"<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'> sql:
postauth_query = "INSERT into radpostauth (id, user, pass, reply,<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>date)
values ('', '%{User-Name}', '%{User-Password:-Chap-Password}',<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>'%{reply:Packet-Type}',
NOW())"<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>it
does not appear and consequently it does not work: ( <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>Solutions?<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>Regards<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>Inviato:
giovedì 26 gennaio 2006 18.41<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>A:
<st1:PersonName w:st="on">FreeRadius users mailing list</st1:PersonName><o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>Oggetto:
Re: R: SQL.conf new query <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>>
I would like to build a new query to insert<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>>
user's MAC address into radcheck table, as users log-out (accounting-stop<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>>
packet). <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>
Just append the query to the existing ones.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>
Alan DeKok.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>- <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>List
info/subscribe/unsubscribe? See<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>http://www.freeradius.org/list/users.html<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>- <o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>List
info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>__________
NOD32 1.1381 (20060126) Information __________<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>This
message was checked by NOD32 antivirus system.<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'>http://www.eset.com<o:p></o:p></span></font></p>
<p class=MsoPlainText><font size=2 face=Arial><span style='font-size:10.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>