Hello Lakmin -

On Wed, 02 Feb 2000, S.K.D. Lakmin Premnath wrote:
> 
> hi hugh
> 
> I am connecting MSSQL through BSDI for authentication and accounting.
> Earlier I have a problem on run a stred procedure and do normal authselect.
> I have come up with a solution using  PreAuthHook
> file:"/usr/local/etc/dbcon %n"  but this script works properly at unix
> command line. But it gave error on mylog  when I include it on cfg file.
> Pls help me to overcome this problem.
> Authentication and Accounting is okay. but script is not running duto this
> error.
> ( Tue Feb  1 11:50:05 2000: ERR: Error in PreAuthHook(): Can't use string
> ("1") as
>  a subroutine ref while "strict refs" in use at
> /usr/local/lib/perl5/site_perl/5
> .005/Radius/Handler.pm line 493.)
> 


My script file "dbcon"

#!/usr/local/bin/perl
use strict;
require DBI;

my $DBSource = "dbi:FreeTDS:database=icaxxx;host=xxxx.xxx.xxx";
my $DBUsername = "xxxx";
my $DBAuth = "xxxx";
my $dbh = DBI->connect($DBSource, $DBUsername, $DBAuth);
my $uname = @ARGV[0];
my $qry = "execute proc_tmp_calsess \'$uname\'";

&prepareAndExecute($dbh, $qry);
$dbh->disconnect;

I suspect your problem has to do with your parameter handling above (@ARGV[0]).

Radiator will pass two arguments to the PreAuthHook, the first is a reference
to the incoming request packet and the second is a reference to the reply
packet being constructed.

You will have to reference the username like this:

my $uname = ${$_[0]}->getAttrByNum($Radius::Radius::USER_NAME);              
     
and your configuration file statement should look like this:

       PreAuthHook file:"/usr/local/etc/dbcon"

Have a look at section 6.13.10 in the Radiator 2.14.1 reference manual.

You also probably shouldn't include the subroutine prepareAndExecute as it is
already defined in Radius/SqlDb.pm.

hth

Hugh

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, etc etc on Unix, Win95/8,
NT, Rhapsody

===
Archive at http://www.thesite.com.au/~radiator/
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to