Hello.

Now checkrad uses this stuff for checking user's
status. As we can see it ignores SessionId value:
ARGV[3] - username and ARGV[1] is nas address.

sub max40xx_finger {
        open(FD, "finger $ARGV[3]\@$ARGV[1]|");
        while(<FD>) {
           $line = <FD>;
           if( $line =~ /Session/ ){
              return 1; # user is online
           }else{
              return 0; # user is offline
           }
        }
        close FD;
}

And here the patch

--- checkrad.pl.in.orig Mon May 13 12:59:51 2002
+++ checkrad.pl.in      Mon May 13 13:03:02 2002
@@ -443,13 +443,15 @@
 sub max40xx_finger {
        open(FD, "finger $ARGV[3]\@$ARGV[1]|");
        while(<FD>) {
-          $line = <FD>;
-          if( $line =~ /Session/ ){
-             return 1; # user is online
-          }else{
-             return 0; # user is offline
-          }
-       }
+               $line = <FD>;
+               if( $line =~ /Session/ ){
+                       next;
+                       }
+               if( $line =~ /$ARGV[4]/ ){
+                       return 1; # user is online
+                       }
+               }
+       return 0; # user is offline
        close FD;
 }

---
Aleksandr Kuzminsky,            AK476-RIPE
System Administrator,           AK16-UANIC
ISP NBI.


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to