Missing field in accounting

Arrigo Savio a.savio at bascom.it
Tue Sep 30 18:04:42 CEST 2008


Hi everybody. I'm trying to complete the setup of freeradius 2.1.1.
I have the following problem:
When the data flow passes from authentication to accounting, I miss the
stripping of the username/realm. I mean: in first authentication step, I
have correctly splitted the username (test) from the realm (realm.com) and
infact the "INSERT INTO radpostauth" is correctly populated.
The next query, that should write into accounting table, doesn't find
%{Stripped-User-Name} and %{Realm} values, so that it put empty fields in
the table. All other fields are correct. BTW, if I put in dialer.conf
accounting query the field %{SQL-User-Name}, I find the field populated with
the whole username (test at realm.com, in the example below).

Can you help me, please?

Arrigo


[sql]   expand: %{Stripped-User-Name} -> test
 [sql] sql_set_user escaped user --> 'test'
.
++[sql] returns ok
Login OK: [prova at realm.com/realm] (from client C831 Test port 92)
+- entering group post-auth {...}
[reply_log]     expand:
/var/log/radius/radacct/%{Client-IP-Address}/reply-detail-%Y%m%d ->
/var/log/radius/radacct/10.0.1.224/reply-detail-20080930
[reply_log] /var/log/radius/radacct/%{Client-IP-Address}/reply-detail-%Y%m%d
expands to /var/log/radius/radacct/10.0.1.224/reply-detail-20080930
[reply_log]     expand: %t -> Tue Sep 30 17:53:01 2008
++[reply_log] returns ok
[sql]   expand: %{Stripped-User-Name} -> test
[sql] sql_set_user escaped user --> 'test'
[sql]   expand: %{User-Password} -> realm
[sql]   expand: INSERT INTO radpostauth                           (username,
realm, pass, reply, authdate)                           VALUES (
'%{Stripped-User-Name}', '%{Realm}',                          '%{%{User-
...
++[sql] returns ok
+- entering group preacct {...}
[acct_unique] Hashing 'NAS-Port = 92,Client-IP-Address =
10.0.1.224,NAS-IP-Address = 10.0.1.224,Acct-Session-Id =
"000000D8",User-Name = "prova at realm.com"'
[acct_unique] Acct-Unique-Session-ID = "1bdfdc3b2335277d".
++[acct_unique] returns ok
+- entering group accounting {...}
[detail]        expand:
/var/log/radius/radacct/%{Client-IP-Address}/detail-%Y%m%d ->
/var/log/radius/radacct/10.0.1.224/detail-20080930
[detail] /var/log/radius/radacct/%{Client-IP-Address}/detail-%Y%m%d expands
to /var/log/radius/radacct/10.0.1.224/detail-20080930
[detail]        expand: %t -> Tue Sep 30 17:53:01 2008
++[detail] returns ok
[sql]   expand: %{Stripped-User-Name} ->
[sql] sql_set_user escaped user --> ''
[sql]   expand: %{Acct-Delay-Time} -> 0
[sql]   expand:            INSERT INTO radacct             (acctsessionid,
acctuniqueid,     username,              realm,            nasipaddress,
nasportid,              nasporttype,      acctstarttime,    acctstoptime,
acctsessiontime,  acctauthentic,    connectinfo_start,
connectinfo_stop, acctinputoctets,  acctoutputoctets,
calledstationid,  callingstationid, acctterminatecause,
servicetype,      framedprotocol,   framedipaddress,
acctstartdelay,   acctstopdelay,    xascendsessionsvrkey)           VALUES
('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}',
'%{Stripped-User-Name}',              '%{Realm}', '%{NAS-IP-Address}',
'%{NAS-Port}',              '%{NAS-Port-Type}', '%S', NULL,
'0', '%{Acct-Authentic}', '%{Connect-Info}',              '', '0', '0',
'%{Called-Station-Id}', '%{Calling-Station-Id}', '',
'%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}',

rlm_sql (sql): Reserving sql socket id: 1
rlm_sql (sql): Released sql socket id: 1
++[sql] returns ok

Arrigo





More information about the Freeradius-Users mailing list