7 use vars qw( $opt $Debug );
9 use Net::SSH qw(sshopen3)
10 use FS::UID qw(adminsuidsetup);
11 use FS::Record qw( qsearch qsearchs );
12 #use FS::cust_main_county;
16 #require "configfile";
19 my $user = shift or die &usage;
20 &adminsuidsetup( $user );
22 my $machine = shift or die &usage;
24 my $fs_sessiond = "/usr/local/sbin/fs_sessiond";
26 my $me = "[fs_session_server]";
29 my($reader, $writer) = (new IO::Handle, new IO::Handle);
30 $writer->autoflush(1);
31 warn "$me Connecting to $machine\n" if $Debug;
32 sshopen2($machine,$reader,$writer,$fs_signupd);
34 warn "$me Entering main loop\n" if $Debug;
36 warn "$me Reading (waiting for) data\n" if $Debug;
37 my $command = scalar(<$reader));
38 #DoS protection here too, to protect against a compromised client? *sigh*
39 while ( ( my $key = scalar(<$reader>) ) != "END\n" ) {
41 chomp( $hash{$key} = scalar(<$reader>) );
44 if ( $command eq 'login' ) {
46 } elsif ( $command eq 'logoff' ) {
48 } elsif ( $command eq 'portnum' ) {
51 warn "$me WARNING: unrecognized command";