Version 3.0.4 sql groups handling issue

Philippe MARASSE philippe.marasse at ch-poitiers.fr
Thu Nov 27 18:08:18 CET 2014


Hello,

I'm upgrading from FR 3.0.0 to 3.0.4, during the tests, I've ran into an 
issue :

  - My NAS are sorted into 2 different huntgroups
  - My users are members of 2 SQL groups
  - Each SQL group is attached to one huntgroup

Under v3.0.4 group processing stops when the first group get processed 
whether huntgroup matches or not.

I think I've found the culprit line 621 in rlm_sql.c, the continue 
instruction skips lines 659 & 660 :
     pairdelete(&request->packet->vps, PW_SQL_GROUP, 0, TAG_ANY);
     entry = entry->next;

As far as Fall-Through's default value has changed from 1 in v3.0.0 to 
FALL_THROUGH_DEFAULT (0), my second group never get processed.

Another test : I've added Fall-Through = Yes into my radreply table : 
bang, infinite loop on the first group ! From my log :

rlm_sql (sql): Executing query: 'SELECT id, groupname, attribute, Value, 
op FROM radgroupcheck WHERE groupname = 'pcs-sites' ORDER BY id'
(1)  sql : EXPAND SELECT id, groupname, attribute, Value, op FROM 
radgroupcheck WHERE groupname = '%{Sql-Group}' ORDER BY id
(1)  sql :    --> SELECT id, groupname, attribute, Value, op FROM 
radgroupcheck WHERE groupname = 'pcs-sites' ORDER BY id
rlm_sql (sql): Executing query: 'SELECT id, groupname, attribute, Value, 
op FROM radgroupcheck WHERE groupname = 'pcs-sites' ORDER BY id'
(1)  sql : EXPAND SELECT id, groupname, attribute, Value, op FROM 
radgroupcheck WHERE groupname = '%{Sql-Group}' ORDER BY id
(1)  sql :    --> SELECT id, groupname, attribute, Value, op FROM 
radgroupcheck WHERE groupname = 'pcs-sites' ORDER BY id
rlm_sql (sql): Executing query: 'SELECT id, groupname, attribute, Value, 
op FROM radgroupcheck WHERE groupname = 'pcs-sites' ORDER BY id'
(1)  sql : EXPAND SELECT id, groupname, attribute, Value, op FROM 
radgroupcheck WHERE groupname = '%{Sql-Group}' ORDER BY id
(1)  sql :    --> SELECT id, groupname, attribute, Value, op FROM 
radgroupcheck WHERE groupname = 'pcs-sites' ORDER BY id
rlm_sql (sql): Executing query: 'SELECT id, groupname, attribute, Value, 
op FROM radgroupcheck WHERE groupname = 'pcs-sites' ORDER BY id'
(1)  sql : EXPAND SELECT id, groupname, attribute, Value, op FROM 
radgroupcheck WHERE groupname = '%{Sql-Group}' ORDER BY id
(1)  sql :    --> SELECT id, groupname, attribute, Value, op FROM 
radgroupcheck WHERE groupname = 'pcs-sites' ORDER BY id
rlm_sql (sql): Executing query: 'SELECT id, groupname, attribute, Value, 
op FROM radgroupcheck WHERE groupname = 'pcs-sites' ORDER BY id'
(1)  sql : EXPAND SELECT id, groupname, attribute, Value, op FROM 
radgroupcheck WHERE groupname = '%{Sql-Group}' ORDER BY id
(1)  sql :    --> SELECT id, groupname, attribute, Value, op FROM 
radgroupcheck WHERE groupname = 'pcs-sites' ORDER BY id

I can post the entire log if needed.
BTW, I've got a look on github, branch 3.0.x, rlm_sql.c seems to have 
the same issue (continue on line 720, skipped lines 769 & 770).

Regards.

-- 
Philippe MARASSE

Responsable pôle Infrastructures - DSIO
Centre Hospitalier Henri Laborit
CS 10587 - 370 avenue Jacques Coeur
86021 Poitiers Cedex
Tel : 05.49.44.57.19


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4326 bytes
Desc: Signature cryptographique S/MIME
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20141127/4401657e/attachment-0001.bin>


More information about the Freeradius-Users mailing list