Musing and digressing around sqlite

Axel Luttgens axel.luttgens at skynet.be
Thu Jul 10 11:26:50 CEST 2014


Le 9 juil. 2014 à 18:54, Axel Luttgens a écrit :

> [...]
> Wed Jul  9 18:13:50 2014 : Debug: (0)  sql : EXPAND INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( '%{SQL-User-Name}', '%{%{User-Password}:-%{Chap-Password}}', '%{reply:Packet-Type}', %{%{Event-Timestamp}:-date('now')})
> Wed Jul  9 18:13:50 2014 : Debug: (0)  sql :    --> INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( 'bob', 'hello', 'Access-Accept', date=28=27now=27=29)
> Wed Jul  9 18:13:50 2014 : Debug: rlm_sql (sql): Executing query: 'INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( 'bob', 'hello', 'Access-Accept', date=28=27now=27=29)'
> Wed Jul  9 18:13:50 2014 : Debug: (0)  sql : No additional queries configured
> 
> Of course, that "date=28=27now=27=29" sequence of characters doesn't make any sense for sqlite, and no row gets inserted into the table.
> 
> Still investigating...

I began to fear unlang was completely broken here, and thus tried with linelog, the idea being to check whether a similar expansion fails in that context too.

Fortunately, this looks a bit more reassuring:


Jul 10 11:11:27 radius.example.com radiusd[2356] <Notice>: (0) Login OK: [bob] (from client localhost port 0)
Jul 10 11:11:27 radius.example.com radiusd[2356] <Debug>: (0) # Executing section post-auth from file /_ROOT/etc/raddb/sites-enabled/default
Jul 10 11:11:27 radius.example.com radiusd[2356] <Debug>: (0)   post-auth {
Jul 10 11:11:27 radius.example.com radiusd[2356] <Debug>: (0)  syslog_post-auth : EXPAND msgs.%{%{reply:Packet-Type}:-format}
Jul 10 11:11:27 radius.example.com radiusd[2356] <Debug>: (0)  syslog_post-auth :    --> msgs.Access-Accept
Jul 10 11:11:27 radius.example.com radiusd[2356] <Debug>: (0)  syslog_post-auth : EXPAND %{User-Name}#%{%{User-Password}:-%{Chap-Password}}#%{reply:Packet-Type}#%{%{Event-Timestamp}:-date('now')}
Jul 10 11:11:27 radius.example.com radiusd[2356] <Debug>: (0)  syslog_post-auth :    --> bob#hello#Access-Accept#date('now')
Jul 10 11:11:27 radius.example.com radiusd[2356] <Info>: bob#hello#Access-Accept#date('now')


So, perhaps could it be inferred that unlang expansions misbehave in an sqlite context only.

Are there other things I could try?

Axel



More information about the Freeradius-Users mailing list