hi<div>thought so at the beginning but I did :)</div><div>The startup of freeradius shows that the module is loaded (called local-sql.conf):</div><div><div>...</div><div>Thu Aug 25 16:26:48 2011 : Debug: including configuration file /etc/raddb/modules/files</div>
<div>Thu Aug 25 16:26:48 2011 : Debug: including configuration file /etc/raddb/modules/policy</div><div>Thu Aug 25 16:26:48 2011 : Debug: including configuration file /etc/raddb/modules/local-sql.conf</div><div>Thu Aug 25 16:26:48 2011 : Debug: including configuration file /etc/raddb/modules/smbpasswd</div>
<div>Thu Aug 25 16:26:48 2011 : Debug: including configuration file /etc/raddb/eap.conf</div><div>Thu Aug 25 16:26:48 2011 : Debug: including configuration file /etc/raddb/policy.conf</div><div>Thu Aug 25 16:26:48 2011 : Debug: including files in directory /etc/raddb/sites-enabled/</div>
<div>Thu Aug 25 16:26:48 2011 : Debug: including configuration file /etc/raddb/sites-enabled/default</div><div>Thu Aug 25 16:26:48 2011 : Debug: including configuration file /etc/raddb/sites-enabled/control-socket</div><div>
Thu Aug 25 16:26:48 2011 : Debug: main {</div></div><div>....</div><div><br></div><div><div>Here is the module:</div><div><div>sql sql_local {</div><div> database = "mysql"</div><div> driver = "rlm_sql_${database}"</div>
<div> server = "localhost"</div><div> login = "radius"</div><div> password = "xxxxxxxxxxxxxxxxxxxx"</div><div> radius_db = "radius-MAB"</div><div> read_groups = no</div>
<div> sqltrace = yes</div><div> sqltracefile = ${logdir}/sqltrace.sql</div><div> num_sql_socks = 5</div><div> connect_failure_retry_delay = 5</div><div> lifetime = 0</div><div> max_queries = 0</div>
<div>}</div></div><div><br></div><div>Can this be version related? i'm running 2.1.10 ...</div><br><div class="gmail_quote">On Thu, Aug 25, 2011 at 5:29 PM, Arran Cudbard-Bell <span dir="ltr"><<a href="mailto:a.cudbardb@freeradius.org">a.cudbardb@freeradius.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word">Means you haven't instantiated your SQL module with the correct instance name.<div>
<br></div><div>Check that the config block for your SQL is :</div><div><br></div><div>sql sql_local {</div><div><br></div><div>}</div><div><br></div><div>-Arran</div><div><br></div><div><br><div><div><div></div><div class="h5">
<div>On 25 Aug 2011, at 16:57, Sébastien Barbereau wrote:</div><br></div></div><blockquote type="cite"><div><div></div><div class="h5">Hi,<div>I am trying to do mac authorization as per <a href="http://wiki.freeradius.org/Mac-Auth#Mac-Auth+authorisation+by+SSID+SQL" target="_blank">http://wiki.freeradius.org/Mac-Auth#Mac-Auth+authorisation+by+SSID+SQL</a></div>
<div>In fact my attempt is much simpler as I just have a very simple table containing the mac address of system to accept. My conf looks like that:</div>
<div><div><br></div><div>authorize {</div><div>...</div><div> # newer authorized macs</div><div> if("%{sql_local:SELECT COUNT(mac) FROM authorized_macs WHERE mac ='%{Calling-Station-ID}'}" > 0){</div>
<div> update control {</div><div> Auth-Type := Accept</div><div> }</div><div> ok = return</div><div> }</div><div><br></div><div>...</div></div><div>
}</div><div><br></div><div>But when doing an authentication attemp I get the following in the debug logs :</div><div>...</div><div><div>Thu Aug 25 16:52:56 2011 : Info: ++? if (ok) -> FALSE</div><div>Thu Aug 25 16:52:56 2011 : Info: ++? if ("%{sql_local:SELECT COUNT(mac) FROM authorized_macs WHERE mac ='%{Calling-Station-ID}'}" > 0)</div>
<div>Thu Aug 25 16:52:56 2011 : Info: WARNING: Unknown module "sql_local" in string expansion "%"</div><div>Thu Aug 25 16:52:56 2011 : Info: ? Evaluating ("%{sql_local:SELECT COUNT(mac) FROM authorized_macs WHERE mac ='%{Calling-Station-ID}'}" > 0) -> FALSE</div>
<div>Thu Aug 25 16:52:56 2011 : Info: ++? if ("%{sql_local:SELECT COUNT(mac) FROM authorized_macs WHERE mac ='%{Calling-Station-ID}'}" > 0) -> FALSE</div><div>...</div></div><div><br></div><div>As far as I can understand the documentation this should be working (<a href="http://wiki.freeradius.org/Rlm_sql#SQL+xlat" target="_blank">http://wiki.freeradius.org/Rlm_sql#SQL+xlat</a>). Any helpful hand which can bring some light to the darkness of my intellect?</div>
<div><br></div><div><br></div><div>Cheers,</div><div>seb.</div><div><br></div></div></div>
-<br>List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" target="_blank">http://www.freeradius.org/list/users.html</a></blockquote></div><br><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><div style="word-wrap:break-word">
<div>Arran Cudbard-Bell</div><div><a href="mailto:a.cudbardb@freeradius.org" target="_blank">a.cudbardb@freeradius.org</a></div><div><br></div><div>RADIUS - Half the complexity of Diameter</div></div></span></span>
</div>
<br></div></div><br>-<br>
List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" target="_blank">http://www.freeradius.org/list/users.html</a><br></blockquote></div><br></div>