--- loncom/lond 2001/08/24 19:25:46 1.49 +++ loncom/lond 2001/08/30 20:02:28 1.51 @@ -15,7 +15,7 @@ # 03/15 Scott Harrison # 03/24 Gerd Kortemeyer # 04/02 Scott Harrison -# 05/11,05/28 Gerd Kortemeyer +# 05/11,05/28,08/30 Gerd Kortemeyer # # based on "Perl Cookbook" ISBN 1-56592-243-3 # preforker - server who forks first @@ -366,7 +366,8 @@ sub make_new_child { my $clientip=inet_ntoa($iaddr); my $clientrec=($hostid{$clientip} ne undef); &logthis( -"INFO: Connect from $clientip ($hostid{$clientip})"); +"INFO: Connection $i, $clientip ($hostid{$clientip})" + ); my $clientok; if ($clientrec) { my $remotereq=<$client>; @@ -477,7 +478,7 @@ sub make_new_child { Authen::Krb4::get_pw_in_tkt($uname,"", $contentpwd,'krbtgt',$contentpwd,1, $upass) == 0); - } elsif ($howpwd eq 'localauth') { + } elsif ($howpwd eq 'localauth') { $pwdcorrect=&localauth::localauth($uname,$upass, $contentpwd); } @@ -567,8 +568,14 @@ sub make_new_child { { my $pf = IO::File->new(">$passfilename"); print $pf "internal:$ncpass\n"; - } + } print $client "ok\n"; + } elsif ($umode eq 'localauth') { + { + my $pf = IO::File->new(">$passfilename"); + print $pf "localauth:$npass\n"; + } + print $client "ok\n"; } elsif ($umode eq 'none') { { my $pf = IO::File->new(">$passfilename"); @@ -1105,6 +1112,13 @@ sub make_new_child { } if ($ulsout eq '') { $ulsout='empty'; } print $client "$ulsout\n"; +# ------------------------------------------------------------------ Hanging up + } elsif (($userinput =~ /^exit/) || + ($userinput =~ /^init/)) { + &logthis( + "Client $clientip ($hostid{$clientip}) hanging up: $userinput"); + print $client "bye\n"; + last; # ------------------------------------------------------------- unknown command } else { # unknown command