Hello William -

On Thursday 26 April 2001 01:25, William Hernandez wrote:
> Hello everyone,
>
> I'm trying to follow Hugh's tips, but I'm doing something wrong.
>
> In my radius.cfg I have:
>
> <AuthBy SQL>
>         Identifier TimeBlock-SQL
>         DBSource        *
>         DBUsername    *
>         DBAuth            *
>         AuthSelect select TIMEBLOCK from XSTOP where
> USERNAME='%n'
>         AuthColumnDef   0, Time, check

This is the problem, as you are trying to do a check with this query. If you 
want to store the value as an attribute called "Time" in the request packet, 
you would do this:

         AuthColumnDef   0, Time, request


> </AuthBy>
> <Realm DEFAULT>
>         AuthBy Check-FILE
>         AuthBy System
>         # This AuthBy will check the Time check-item
>         AuthBy TimeBlock-SQL
>         # This hook calculates the session-timeout
>         PostAuthHook file:"/etc/raddb/setSessionTimeout"
>         AcctLogFileName /var/log/radacct/detail
>         PasswordLogFileName     /var/log/radius.log
>         ExcludeFromPasswordLog  root
> </Realm>
>
> In my PostAuthHook I have:
>       my $timeblock=$p->get_attr('Time');
>

See above, until you store the value from the database in the request packet, 
this won't work ($p is a pointer to the current request packet).

> The problem is $timeblock is coming back an empty string. I can't
> get the value to the PostAuthHook.
> The "ERR: Invalid timeblock for user whr" in the radius.log comes
> from the PostAuthHook.
>
> A Trace 4 radius.log shows:
> Wed Apr 25 11:05:31 2001: DEBUG: Packet dump:
> *** Received from 208.249.78.6 port 4319 ....
> Code:       Access-Request
> Identifier: 196
> Authentic:  1234567890123456
> Attributes:
>         User-Name = "whr"
>         Service-Type = Framed-User
>         NAS-IP-Address = 203.63.154.1
>         NAS-Port = 1234
>         NAS-Port-Type = Async
>         User-Password =
> "<146><208><238><158><247><22><144><5><164><133><228><17
> 4><1>H<30>x"
>
> Wed Apr 25 11:05:31 2001: DEBUG: Handling request with Handler
> 'Realm=DEFAULT'
> Wed Apr 25 11:05:31 2001: DEBUG:  Deleting session for whr,
> 203.63.154.1, 1234
> Wed Apr 25 11:05:31 2001: DEBUG: do query is: delete from
> RADONLINE where NASIDE
> NTIFIER='203.63.154.1' and NASPORT=01234
>
> Wed Apr 25 11:05:31 2001: DEBUG: Handling with Radius::AuthFILE
> Wed Apr 25 11:05:31 2001: DEBUG: Radius::AuthFILE looks for match
> with whr
> Wed Apr 25 11:05:31 2001: DEBUG: Radius::AuthFILE looks for match
> with DEFAULT
> Wed Apr 25 11:05:31 2001: DEBUG: Handling with Radius::AuthUNIX
> Wed Apr 25 11:05:31 2001: DEBUG: Radius::AuthUNIX looks for match
> with whr
> Wed Apr 25 11:05:31 2001: DEBUG: Query is: select NASIDENTIFIER,
> NASPORT, ACCTSE
> SSIONID from RADONLINE where USERNAME='whr'
>
> Wed Apr 25 11:05:31 2001: Login OK: [whr] (home)
> Wed Apr 25 11:05:31 2001: DEBUG: Radius::AuthUNIX ACCEPT:
> Wed Apr 25 11:05:31 2001: DEBUG: Radius::AuthFILE ACCEPT:
> Wed Apr 25 11:05:31 2001: ERR: Invalid timeblock for user whr
> Wed Apr 25 11:05:31 2001: DEBUG: Access accepted for whr
> Wed Apr 25 11:05:31 2001: DEBUG: Packet dump:
> *** Sending to 208.249.78.6 port 4319 ....
> Code:       Access-Accept
> Identifier: 196
> Authentic:  1234567890123456
> Attributes:
>         Service-Type = Framed-User
>         Framed-Protocol = PPP
>         Framed-IP-Netmask = 255.255.255.255
>         Framed-Compression = Van-Jacobson-TCP-IP
>         Ascend-Idle-Limit = 900
>

hth

Hugh

-- 
Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.

===
Archive at http://www.starport.net/~radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to