--- loncom/lond 2001/03/27 12:49:18 1.43 +++ loncom/lond 2001/08/24 21:09:53 1.50 @@ -14,6 +14,8 @@ # 02/12 Gerd Kortemeyer # 03/15 Scott Harrison # 03/24 Gerd Kortemeyer +# 04/02 Scott Harrison +# 05/11,05/28 Gerd Kortemeyer # # based on "Perl Cookbook" ISBN 1-56592-243-3 # preforker - server who forks first @@ -30,6 +32,8 @@ use Crypt::IDEA; use LWP::UserAgent(); use GDBM_File; use Authen::Krb4; +use lib '/home/httpd/lib/perl/'; +use localauth; # grabs exception and records it to log before exiting sub catchexception { @@ -473,7 +477,10 @@ sub make_new_child { Authen::Krb4::get_pw_in_tkt($uname,"", $contentpwd,'krbtgt',$contentpwd,1, $upass) == 0); - } + } elsif ($howpwd eq 'localauth') { + $pwdcorrect=&localauth::localauth($uname,$upass, + $contentpwd); + } if ($pwdcorrect) { print $client "authorized\n"; } else { @@ -560,8 +567,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"); @@ -707,7 +720,7 @@ sub make_new_child { chomp($what); my $proname=propath($udom,$uname); my $now=time; - { + unless ($namespace=~/^nohist\_/) { my $hfh; if ( $hfh=IO::File->new(">>$proname/$namespace.hist") @@ -832,7 +845,7 @@ sub make_new_child { chomp($what); my $proname=propath($udom,$uname); my $now=time; - { + unless ($namespace=~/^nohist\_/) { my $hfh; if ( $hfh=IO::File->new(">>$proname/$namespace.hist") @@ -903,7 +916,7 @@ sub make_new_child { chomp($what); my $proname=propath($udom,$uname); my $now=time; - { + unless ($namespace=~/^nohist\_/) { my $hfh; if ( $hfh=IO::File->new(">>$proname/$namespace.hist") @@ -969,16 +982,17 @@ sub make_new_child { } # ------------------------------------------------------------------- querysend } elsif ($userinput =~ /^querysend/) { - my ($cmd,$query,$custom)=split(/:/,$userinput); + my ($cmd,$query, + $custom,$customshow)=split(/:/,$userinput); $query=~s/\n*$//g; - unless ($custom) { + unless ($custom or $customshow) { print $client "". sqlreply("$hostid{$clientip}\&$query")."\n"; } else { print $client "". sqlreply("$hostid{$clientip}\&$query". - "\&$custom")."\n"; + "\&$custom"."\&$customshow")."\n"; } # ------------------------------------------------------------------ queryreply } elsif ($userinput =~ /^queryreply/) { @@ -989,6 +1003,9 @@ sub make_new_child { $reply=~s/\&/\n/g; print $store $reply; close $store; + my $store2=IO::File->new(">$execdir/tmp/$id.end"); + print $store2 "done\n"; + close $store2; print $client "ok\n"; } else { @@ -1084,7 +1101,7 @@ sub make_new_child { if (-e $ulsdir) { if (opendir(LSDIR,$ulsdir)) { while ($ulsfn=readdir(LSDIR)) { - my @ulsstats=stat($ulsfn); + my @ulsstats=stat($ulsdir.'/'.$ulsfn); $ulsout.=$ulsfn.'&'.join('&',@ulsstats).':'; } closedir(LSDIR);