rlm_sql bug in 64-bit architecture ?

Richard Cotrina rcc at speedy.net.pe
Tue Jul 24 20:57:25 CEST 2007


Hi everyone :

I've been searching for the possible causes of a problem, that appears when
sqlcounter is enabled, and just in 64-bits plattforms (FreeBSD/Sparc64). The
radius_xlat function performed by rlm_sql seems to not reading well some
attributes like "Expiration" and always complains about "Invalid Operator",
not matter what operator is put [1].

Note the big difference between the responses obtained in the 64-bit and
32-bit arch, using radtest and running radiusd in debug mode: rlm_sql can't
read neither the value nor the operator for Expiration attribute, despite
the fact that in both cases, the database used is the same. (rlm_sql debug
options enabled in rlm_sql.c).

freeradius 1.1.6 / FreeBSD Sparc64
==========================

radius_xlat:  'prueba at test.com'
rlm_sql (sql): [snip]
radius_xlat:  [snip]
rlm_sql:  check items
     User-Password := "prueba"
     Auth-Type := Local
     Simultaneous-Use := 1
     Max-Daily-Session := 3600
     Expiration <INVALID-TOKEN> "Dec 31 1969 19:00:00 PET"     <--- Notice
this (where this value come from ?)
rlm_sql:  reply items
     Framed-Protocol = PPP
     Framed-IP-Address = 255.255.255.254
     Framed-IP-Netmask = 255.255.255.255
     Framed-MTU = 1500
     Service-Type = Framed-User
     Idle-Timeout = 300
Invalid operator for item Expiration: reverting to '=='
Invalid operator for item Expiration: reverting to '=='
Invalid operator for item Expiration: reverting to '=='
Invalid operator for item Expiration: reverting to '=='
Invalid operator for item Expiration: reverting to '=='
Invalid operator for item Expiration: reverting to '=='
Invalid operator for item Expiration: reverting to '=='
rlm_sql (sql): No matching entry in the database for request from user
[prueba at test.com]
  modcall[authorize]: module "sql" returns notfound for request 9
rlm_sqlcounter: Entering module authorize code
rlm_sqlcounter: Could not find Check item value pair
  modcall[authorize]: module "dailycounter" returns noop for request 9
[snip]

--> Got an Access-Reject response


freeradius 1.1.6 / FreeBSD i386
=======================

radius_xlat:  'prueba at test.com'
rlm_sql (sql): [snip]
radius_xlat:  [snip]
rlm_sql:  check items
     User-Password := "prueba"
     Auth-Type := Local
     Simultaneous-Use := 1
     Max-Daily-Session := 3600
     Expiration := "Sep 24 2007 11:30:00 PET"       <--- get the correct
'op' and 'value'
rlm_sql:  reply items
     Framed-Protocol = PPP
     Framed-IP-Address = 255.255.255.254
     Framed-IP-Netmask = 255.255.255.255
     Framed-MTU = 1500
     Service-Type = Framed-User
     Idle-Timeout = 300
  modcall[authorize]: module "sql" returns ok for request 0
rlm_sqlcounter: Entering module authorize code
[snip]

--> Got an Access-Accept response


What could be going wrong with rlm_sql ? Is there any bug in freeradius code
related to 64-bit architectures ?


I'd appreciate any suggestion to solve this.


Richard Cotrina

[1]. http://archives.free.net.ph/message/20070517.165523.c7432a23.en.html




More information about the Freeradius-Users mailing list