Hello SJ -

On Thu, 15 Jun 2000, [EMAIL PROTECTED] wrote:
> I tried the PreAuthHook, but I've got a problem 
> 
> Details from the config file:
> -----------------------------
> 
> <Realm DEFAULT>
>       PreAuthHook file:"/d1/rad/data/hook1.pl"
>       <AuthBy SQL>
>               ....
>       </AuthBy>
> </Realm>
> 
> The Perl test file:
> -------------------
> 
> #!/usr/local/bin/perl
> #
> 
> use DBI;
> use strict;
>  
> sub{
> 
> $dsn = "DBI:mysql:radius";
> my $dbh = DBI->connect($dsn,"xxxx","xxxxx") || die "DB open error";
> $sth = $dbh->prepare("update SUBSCRIBERS set MINUTES=MINUTES-1 where
> USERNAME='jim'");
> $sth->execute;
> $sth->finish;
> $dbh->disconnect();
> 
> }
> 
> 
> When I tried to run the script from the command line, it decremented the
> MINUTES column by 1. When I used the radpwtst utility, it decremented by 3, I think 
>the
> script has run 3 times.
> 
> Can someone tell me what's wrong ?
> 

There is nothing wrong. The radpwtst utility sends three requests by default:
an Access-Request, an Accounting Start and an Accounting Stop. Hence your Hook
is being called 3 times.

regards

Hugh


-- 
Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, 
Platypus, Freeside, Interbiller, TACACS+, PAM, external, etc, etc.
Available on Unix, Linux, FreeBSD, Windows 95/98/2000, NT, MacOS X.



===
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