Re: (RADIATOR) Radiator PostAuthHook

1999-06-17 Thread Anonymous

Hi Ian,


On Jun 17,  4:09pm, Ian Hughes wrote:
 Subject: (RADIATOR) Radiator PostAuthHook

   Trying to use thePostAuthHook function ot have Radiator generate some
 custom logs to give details of all attempted logins. Current PostAuthHook
 shown below;

Contrary to the documentation, you need to dereference $_[0] like this:
my $nas_ip = ${$_[0]}-get_attr('NAS-IP-Address');
and $_[2] like this:
if ${$_[2]} == $main::REJECT;

We apologise for the error in our docs.
Hope that helps.

Cheers.



 PostAuthHook sub {my $filename = "/usr/local/radius/logs/testlog"; \

   my $time = time; \
   my $ctime = localtime($time); \
   my $nas_ip = $_[0]-get_attr('NAS-IP-Address'); \
   my $phone = $_[0]-get_attr('Called-Station-Id'); \
   my $user = $_[0]-get_attr('User-Name'); \
   my $r = "NULL"; \
   $nas_ip = "POP3 mail" \
   if $nas_ip eq "196.14.80.129";\
   $r = "DENY" \
   if $_[2] == $main::REJECT; \
   $r = "ACCEPT" \
   if $_[2] == $main::ACCEPT;\
   open(LOG, "$filename");\
   print LOG "$ctime: UserName \"$user\": Dialed $phone
 - $nas_ip - $r\n";\
   close(LOG); }

 No compilation errors are reported, however when a request is processed the
 log file reports the following error message;

 Thu Jun  3 10:30:56 1999: ERR: Error in PostAuthHook(): Can't call method
 "get_attr" on unblessed reference at (eval 189) line 1.

 Radiator version - 2.13.1
 Patched - patches-2.13.1.tar.gz - June 3 1999
 Any suggestions on how to overcome this would be greatly appreciated..

 Regards

 Ian Hughes

 +--+
   Ian Hughes - Tech Support/System Admin.
   Hunterlink Pty. Ltd. (Australia)
   1st Floor, 805 Hunter Street
   Dangar, NSW, 2309 Australia
   Phone: +61 2 4969 0122  Fax: +61 2 4969 0133
   E-Mail: [EMAIL PROTECTED]
 +--+
   If things get any worse, I'll have to ask you to stop helping me.
 +--+



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



-- 
Mike McCauley   [EMAIL PROTECTED]
Open System Consultants Pty. LtdUnix, 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, 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.



(RADIATOR) Radiator PostAuthHook

1999-06-16 Thread Anonymous


  Trying to use thePostAuthHook function ot have Radiator generate some
custom logs to give details of all attempted logins. Current PostAuthHook
shown below;

PostAuthHook sub {  my $filename = "/usr/local/radius/logs/testlog"; \

my $time = time; \
my $ctime = localtime($time); \
my $nas_ip = $_[0]-get_attr('NAS-IP-Address'); \
my $phone = $_[0]-get_attr('Called-Station-Id'); \
my $user = $_[0]-get_attr('User-Name'); \
my $r = "NULL"; \
$nas_ip = "POP3 mail" \
if $nas_ip eq "196.14.80.129";\
$r = "DENY" \
if $_[2] == $main::REJECT; \
$r = "ACCEPT" \
if $_[2] == $main::ACCEPT;\
open(LOG, "$filename");\
print LOG "$ctime: UserName \"$user\": Dialed $phone
- $nas_ip - $r\n";  \
close(LOG); }

No compilation errors are reported, however when a request is processed the
log file reports the following error message;

Thu Jun  3 10:30:56 1999: ERR: Error in PostAuthHook(): Can't call method
"get_attr" on unblessed reference at (eval 189) line 1.

Radiator version - 2.13.1
Patched - patches-2.13.1.tar.gz - June 3 1999
Any suggestions on how to overcome this would be greatly appreciated..

Regards

Ian Hughes

+--+
  Ian Hughes - Tech Support/System Admin.
  Hunterlink Pty. Ltd. (Australia)
  1st Floor, 805 Hunter Street
  Dangar, NSW, 2309 Australia
  Phone: +61 2 4969 0122  Fax: +61 2 4969 0133
  E-Mail: [EMAIL PROTECTED]
+--+
  If things get any worse, I'll have to ask you to stop helping me.
+--+



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