----------  Forwarded Message  ----------

Subject: BOUNCE [EMAIL PROTECTED]:    Non-member submission from ["Claudio 
Lapidus" <[EMAIL PROTECTED]>]
Date: Sun, 2 Feb 2003 16:49:40 -0600
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

>From [EMAIL PROTECTED] Sun Feb  2 16:49:35 2003
Received: from hotmail.com (f64.law9.hotmail.com [64.4.9.64])
        by server1.open.com.au (8.11.0/8.11.0) with ESMTP id h12MnYx03611;
        Sun, 2 Feb 2003 16:49:34 -0600
Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;
         Sun, 2 Feb 2003 19:47:43 -0800
Received: from 200.45.98.194 by lw9fd.law9.hotmail.msn.com with HTTP;
        Mon, 03 Feb 2003 03:47:43 GMT
X-Originating-IP: [200.45.98.194]
From: "Claudio Lapidus" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: (RADIATOR) Retrieving a hook by filename from inside
 ClientListSQL Date: Mon, 03 Feb 2003 00:47:43 -0300
Mime-Version: 1.0
Content-Type: text/plain; format=flowed
Message-ID: <[EMAIL PROTECTED]>
X-OriginalArrivalTime: 03 Feb 2003 03:47:43.0733 (UTC)
 FILETIME=[02053250:01C2CB37]

Hello Toomas et al.

Sorry for not answering your first post earlier, I unattended this mailbox a
couple of days...

About the issue you mention, we also needed to be able to select prehandler
hook from an SQL value, but as Mike pointed out back then, that is not
possible, at least directly. By further testing, we also realized that
Radiator doesn't know how to update its client list during runtime, i.e. the
client list is only read once, during initialization (or kill -USR1, I
think, am I wrong Hugh?). Then our final solution was simply to use a clause
like

include /home/radiator/Radiator-3.3.1/rad_clients|

and setup a perl file containing:

-------------------<snip>-------------------
#!/usr/bin/perl
use DBI;
$dbh = DBI->connect ( "dbi:Pg:dbname=xxxxxxx;host=xx.xx.xx.xx", "xxxxx",
"xxxxx");
if ( !defined $dbh ) {
die "Cannot connect to database!\n";
}

$sth = $dbh->prepare( "SELECT nasidentifier, nastype, secret, prehandlerhook
FROM radclientlist");
if ( !defined $sth ) {
die "Cannot prepare statement: $DBI::errstr\n";
}
$sth->execute;
while ( ($nas_id, $nas_type, $nas_secret, $pre_handler) = $sth->fetchrow()){

print "<Client $nas_id>\n   Secret $nas_secret\n   NasType $nas_type\n
PreHandlerHook $pre_handler\n</Client>\n";
}
$sth->finish;
$dbh->disconnect;
-------------------</snip>-------------------

This way, the client list is generated (from SQL data) at daemon startup and
included inline with the rest of the configuration, so we can enjoy the best
of both worlds, the client data stored efficiently in SQL and the compact
'file:"scriptname.pl"' notation as a pointer to further code. Perhaps it
needs some refinement, especially in error handling, but it works fine.
Anyway, I continue thinking that it would be better to have it handled
directly by the main code, but I was unable to convince Mike and Hugh at
that time :-)

Mike, if you want to add the script to contrib, please credit German Gatica,
as he was the person who wrote it.

kind regards
cl.


_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus

-------------------------------------------------------

-- 
Mike McCauley                               [EMAIL PROTECTED]
Open System Consultants Pty. Ltd            Unix, Perl, Motif, C++, WWW
24 Bateman St Hampton, VIC 3188 Australia   http://www.open.com.au
Phone +61 3 9598-0985                       Fax   +61 3 9598-0955

Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, 
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS, 
TTLS, PEAP etc on Unix, Windows, MacOS etc.

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

Reply via email to