Unix TimeStamp Based Login

jomajo ster.efx at gmail.com
Wed May 16 17:32:56 CEST 2012


I add  update reply {   Session-Timeout := "%{expr:%{Resv-End-Time} -
%{Resv-Cur-Time}}" 
into authentication and post-auth sections.

User can login at this time , but the session-timeout says "++[reply]
returns notfound" :

# Executing section authorize from file
/etc/freeradius/sites-enabled/default
+- entering group authorize {...}
sql_xlat
        expand: %{User-Name} -> ieva
sql_set_user escaped user --> 'ieva'
        expand: select start_time from resv where username='%{User-Name}' ->
select start_time from resv where username='ieva'
rlm_sql (sql): Reserving sql socket id: 3
sql_xlat finished
rlm_sql (sql): Released sql socket id: 3
        expand: %{sql:select start_time from resv where
username='%{User-Name}'} -> 1337176800
sql_xlat
        expand: %{User-Name} -> ieva
sql_set_user escaped user --> 'ieva'
        expand: select end_time from resv where username='%{User-Name}' ->
select end_time from resv where username='ieva'
rlm_sql (sql): Reserving sql socket id: 2
sql_xlat finished
rlm_sql (sql): Released sql socket id: 2
        expand: %{sql:select end_time from resv where
username='%{User-Name}'} -> 1337183000
        expand: %l -> 1337182192
++[request] returns notfound
++? if (Resv-Cur-Time < "%{Resv-Start-Time}")
        expand: %{Resv-Start-Time} -> 1337176800
? Evaluating (Resv-Cur-Time < "%{Resv-Start-Time}") -> FALSE
++? if (Resv-Cur-Time < "%{Resv-Start-Time}") -> FALSE
++? if (Resv-Cur-Time > "%{Resv-End-Time}")
        expand: %{Resv-End-Time} -> 1337183000
? Evaluating (Resv-Cur-Time > "%{Resv-End-Time}") -> FALSE
++? if (Resv-Cur-Time > "%{Resv-End-Time}") -> FALSE
        expand: %{Resv-End-Time} - %{Resv-Cur-Time} -> 1337183000 -
1337182192
        expand: %{expr:%{Resv-End-Time} - %{Resv-Cur-Time}} -> 808
++[reply] returns notfound
++[preprocess] returns ok
[auth_log]      expand:
/var/log/freeradius/radacct/%{Client-IP-Address}/auth-detail-%Y%m%d ->
/var/log/freeradius/radacct/10.0.0.100/auth-detail-20120516
[auth_log]
/var/log/freeradius/radacct/%{Client-IP-Address}/auth-detail-%Y%m%d expands
to /var/log/freeradius/radacct/10.0.0.100/auth-detail-20120516
[auth_log]      expand: %t -> Wed May 16 18:29:52 2012
++[auth_log] returns ok
[sql]   expand: %{User-Name} -> ieva
[sql] sql_set_user escaped user --> 'ieva'
rlm_sql (sql): Reserving sql socket id: 1
[sql]   expand: SELECT id, username, attribute, value, op           FROM
radcheck           WHERE username = '%{SQL-User-Name}'           ORDER BY id
-> SELECT id, username, attribute, value, op           FROM radcheck          
WHERE username = 'ieva'           ORDER BY id
[sql] User found in radcheck table
[sql]   expand: SELECT id, username, attribute, value, op           FROM
radreply           WHERE username = '%{SQL-User-Name}'           ORDER BY id
-> SELECT id, username, attribute, value, op           FROM radreply          
WHERE username = 'ieva'           ORDER BY id
rlm_sql (sql): Released sql socket id: 1
++[sql] returns ok
++[expiration] returns noop
++[logintime] returns noop
rlm_checkval: Item Name: Calling-Station-Id, Value: 10.0.0.245
rlm_checkval: Could not find attribute named Calling-Station-Id in check
pairs
++[checkval] returns notfound
++[pap] returns updated
Found Auth-Type = PAP
# Executing group from file /etc/freeradius/sites-enabled/default
+- entering group PAP {...}
[pap] login attempt with password "ieva"
[pap] Using clear text password "ieva"
[pap] User authenticated successfully
++[pap] returns ok
# Executing section post-auth from file
/etc/freeradius/sites-enabled/default
+- entering group post-auth {...}
        expand: %{Resv-End-Time} - %{Resv-Cur-Time} -> 1337183000 -
1337182192
        expand: %{expr:%{Resv-End-Time} - %{Resv-Cur-Time}} -> 808
++[reply] returns noop
[sql]   expand: %{User-Name} -> ieva
[sql] sql_set_user escaped user --> 'ieva'
[sql]   expand: %{User-Password} -> ieva
[sql]   expand: INSERT INTO radpostauth                           (username,
pass, reply, authdate)                           VALUES (                          
'%{User-Name}',                          
'%{%{User-Password}:-%{Chap-Password}}',                          
'%{reply:Packet-Type}', '%S') -> INSERT INTO radpostauth                          
(username, pass, reply, authdate)                           VALUES (                          
'ieva',                           'ieva',                          
'Access-Accept', '2012-05-16 18:29:52')
rlm_sql (sql) in sql_postauth: query is INSERT INTO radpostauth                          
(username, pass, reply, authdate)                           VALUES (                          
'ieva',                           'ieva',                          
'Access-Accept', '2012-05-16 18:29:52')
rlm_sql (sql): Reserving sql socket id: 0
rlm_sql (sql): Released sql socket id: 0
++[sql] returns ok
[sql_log] Processing sql_log_postauth
[sql_log]       expand: %{User-Name} -> ieva
[sql_log]       expand: %{%{User-Name}:-DEFAULT} -> ieva
[sql_log] sql_set_user escaped user --> 'ieva'
[sql_log] WARNING: Deprecated conditional expansion ":-".  See "man unlang"
for details
[sql_log]       expand: INSERT INTO radpostauth                         
(username, pass, reply, authdate) VALUES                       
('%{User-Name}', '%{User-Password:-Chap-Password}',                
'%{reply:Packet-Type}', '%S'); -> INSERT INTO radpostauth                      
(username, pass, reply, authdate) VALUES                            ('ieva',
'ieva',                'Access-Accept', '2012-05-16 18:29:52');
[sql_log]       expand: /var/log/freeradius/radacct/sql-relay ->
/var/log/freeradius/radacct/sql-relay
++[sql_log] returns ok
++[exec] returns noop
Sending Access-Accept of id 180 to 10.0.0.100 port 1645
        Session-Timeout = 808
Finished request 0.
Going to the next request
Waking up in 4.9 seconds.


Can you suggest where should I look now? 

--
View this message in context: http://freeradius.1045715.n5.nabble.com/Unix-TimeStamp-Based-Login-tp5708187p5710947.html
Sent from the FreeRadius - User mailing list archive at Nabble.com.


More information about the Freeradius-Users mailing list