File:  [LON-CAPA] / loncom / lond
Revision 1.50: download - view: text, annotated - select for diffs
Fri Aug 24 21:09:53 2001 UTC (22 years, 8 months ago) by albertel
Branches: MAIN
CVS tags: HEAD
- added the localauth authentication mech

    1: #!/usr/bin/perl
    2: # The LearningOnline Network
    3: # lond "LON Daemon" Server (port "LOND" 5663)
    4: # 5/26/99,6/4,6/10,6/11,6/14,6/15,6/26,6/28,6/30,
    5: # 7/8,7/9,7/10,7/12,7/17,7/19,9/21,
    6: # 10/7,10/8,10/9,10/11,10/13,10/15,11/4,11/16,
    7: # 12/7,12/15,01/06,01/11,01/12,01/14,2/8,
    8: # 03/07,05/31 Gerd Kortemeyer
    9: # 06/26 Scott Harrison
   10: # 06/29,06/30,07/14,07/15,07/17,07/20,07/25,09/18 Gerd Kortemeyer
   11: # 12/05 Scott Harrison
   12: # 12/05,12/13,12/29 Gerd Kortemeyer
   13: # Jan 01 Scott Harrison
   14: # 02/12 Gerd Kortemeyer
   15: # 03/15 Scott Harrison
   16: # 03/24 Gerd Kortemeyer
   17: # 04/02 Scott Harrison
   18: # 05/11,05/28 Gerd Kortemeyer
   19: #
   20: # based on "Perl Cookbook" ISBN 1-56592-243-3
   21: # preforker - server who forks first
   22: # runs as a daemon
   23: # HUPs
   24: # uses IDEA encryption
   25: 
   26: use IO::Socket;
   27: use IO::File;
   28: use Apache::File;
   29: use Symbol;
   30: use POSIX;
   31: use Crypt::IDEA;
   32: use LWP::UserAgent();
   33: use GDBM_File;
   34: use Authen::Krb4;
   35: use lib '/home/httpd/lib/perl/';
   36: use localauth;
   37: 
   38: # grabs exception and records it to log before exiting
   39: sub catchexception {
   40:     my ($error)=@_;
   41:     $SIG{'QUIT'}='DEFAULT';
   42:     $SIG{__DIE__}='DEFAULT';
   43:     &logthis("<font color=red>CRITICAL: "
   44:      ."ABNORMAL EXIT. Child $$ for server $wasserver died through "
   45:      ."a crash with this error msg->[$error]</font>");
   46:     if ($client) { print $client "error: $error\n"; }
   47:     die($error);
   48: }
   49: 
   50: # -------------------------------- Set signal handlers to record abnormal exits
   51: 
   52: $SIG{'QUIT'}=\&catchexception;
   53: $SIG{__DIE__}=\&catchexception;
   54: 
   55: # ------------------------------------ Read httpd access.conf and get variables
   56: 
   57: open (CONFIG,"/etc/httpd/conf/access.conf") || die "Can't read access.conf";
   58: 
   59: while ($configline=<CONFIG>) {
   60:     if ($configline =~ /PerlSetVar/) {
   61: 	my ($dummy,$varname,$varvalue)=split(/\s+/,$configline);
   62:         chomp($varvalue);
   63:         $perlvar{$varname}=$varvalue;
   64:     }
   65: }
   66: close(CONFIG);
   67: 
   68: # ----------------------------- Make sure this process is running from user=www
   69: my $wwwid=getpwnam('www');
   70: if ($wwwid!=$<) {
   71:    $emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}";
   72:    $subj="LON: $perlvar{'lonHostID'} User ID mismatch";
   73:    system("echo 'User ID mismatch.  lond must be run as user www.' |\
   74:  mailto $emailto -s '$subj' > /dev/null");
   75:    exit 1;
   76: }
   77: 
   78: # --------------------------------------------- Check if other instance running
   79: 
   80: my $pidfile="$perlvar{'lonDaemons'}/logs/lond.pid";
   81: 
   82: if (-e $pidfile) {
   83:    my $lfh=IO::File->new("$pidfile");
   84:    my $pide=<$lfh>;
   85:    chomp($pide);
   86:    if (kill 0 => $pide) { die "already running"; }
   87: }
   88: 
   89: $PREFORK=4; # number of children to maintain, at least four spare
   90: 
   91: # ------------------------------------------------------------- Read hosts file
   92: 
   93: open (CONFIG,"$perlvar{'lonTabDir'}/hosts.tab") || die "Can't read host file";
   94: 
   95: while ($configline=<CONFIG>) {
   96:     my ($id,$domain,$role,$name,$ip)=split(/:/,$configline);
   97:     chomp($ip);
   98:     $hostid{$ip}=$id;
   99:     if ($id eq $perlvar{'lonHostID'}) { $thisserver=$name; }
  100:     $PREFORK++;
  101: }
  102: close(CONFIG);
  103: 
  104: # establish SERVER socket, bind and listen.
  105: $server = IO::Socket::INET->new(LocalPort => $perlvar{'londPort'},
  106:                                 Type      => SOCK_STREAM,
  107:                                 Proto     => 'tcp',
  108:                                 Reuse     => 1,
  109:                                 Listen    => 10 )
  110:   or die "making socket: $@\n";
  111: 
  112: # --------------------------------------------------------- Do global variables
  113: 
  114: # global variables
  115: 
  116: $MAX_CLIENTS_PER_CHILD  = 5;        # number of clients each child should 
  117:                                     # process
  118: %children               = ();       # keys are current child process IDs
  119: $children               = 0;        # current number of children
  120: 
  121: sub REAPER {                        # takes care of dead children
  122:     $SIG{CHLD} = \&REAPER;
  123:     my $pid = wait;
  124:     $children --;
  125:     &logthis("Child $pid died");
  126:     delete $children{$pid};
  127: }
  128: 
  129: sub HUNTSMAN {                      # signal handler for SIGINT
  130:     local($SIG{CHLD}) = 'IGNORE';   # we're going to kill our children
  131:     kill 'INT' => keys %children;
  132:     my $execdir=$perlvar{'lonDaemons'};
  133:     unlink("$execdir/logs/lond.pid");
  134:     &logthis("<font color=red>CRITICAL: Shutting down</font>");
  135:     exit;                           # clean up with dignity
  136: }
  137: 
  138: sub HUPSMAN {                      # signal handler for SIGHUP
  139:     local($SIG{CHLD}) = 'IGNORE';  # we're going to kill our children
  140:     kill 'INT' => keys %children;
  141:     close($server);                # free up socket
  142:     &logthis("<font color=red>CRITICAL: Restarting</font>");
  143:     unlink("$execdir/logs/lond.pid");
  144:     my $execdir=$perlvar{'lonDaemons'};
  145:     exec("$execdir/lond");         # here we go again
  146: }
  147: 
  148: # --------------------------------------------------------------------- Logging
  149: 
  150: sub logthis {
  151:     my $message=shift;
  152:     my $execdir=$perlvar{'lonDaemons'};
  153:     my $fh=IO::File->new(">>$execdir/logs/lond.log");
  154:     my $now=time;
  155:     my $local=localtime($now);
  156:     print $fh "$local ($$): $message\n";
  157: }
  158: 
  159: 
  160: # -------------------------------------------------------- Escape Special Chars
  161: 
  162: sub escape {
  163:     my $str=shift;
  164:     $str =~ s/(\W)/"%".unpack('H2',$1)/eg;
  165:     return $str;
  166: }
  167: 
  168: # ----------------------------------------------------- Un-Escape Special Chars
  169: 
  170: sub unescape {
  171:     my $str=shift;
  172:     $str =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
  173:     return $str;
  174: }
  175: 
  176: # ----------------------------------------------------------- Send USR1 to lonc
  177: 
  178: sub reconlonc {
  179:     my $peerfile=shift;
  180:     &logthis("Trying to reconnect for $peerfile");
  181:     my $loncfile="$perlvar{'lonDaemons'}/logs/lonc.pid";
  182:     if (my $fh=IO::File->new("$loncfile")) {
  183: 	my $loncpid=<$fh>;
  184:         chomp($loncpid);
  185:         if (kill 0 => $loncpid) {
  186: 	    &logthis("lonc at pid $loncpid responding, sending USR1");
  187:             kill USR1 => $loncpid;
  188:             sleep 1;
  189:             if (-e "$peerfile") { return; }
  190:             &logthis("$peerfile still not there, give it another try");
  191:             sleep 5;
  192:             if (-e "$peerfile") { return; }
  193:             &logthis(
  194:  "<font color=blue>WARNING: $peerfile still not there, giving up</font>");
  195:         } else {
  196: 	    &logthis(
  197:               "<font color=red>CRITICAL: "
  198:              ."lonc at pid $loncpid not responding, giving up</font>");
  199:         }
  200:     } else {
  201:       &logthis('<font color=red>CRITICAL: lonc not running, giving up</font>');
  202:     }
  203: }
  204: 
  205: # -------------------------------------------------- Non-critical communication
  206: 
  207: sub subreply {
  208:     my ($cmd,$server)=@_;
  209:     my $peerfile="$perlvar{'lonSockDir'}/$server";
  210:     my $sclient=IO::Socket::UNIX->new(Peer    =>"$peerfile",
  211:                                       Type    => SOCK_STREAM,
  212:                                       Timeout => 10)
  213:        or return "con_lost";
  214:     print $sclient "$cmd\n";
  215:     my $answer=<$sclient>;
  216:     chomp($answer);
  217:     if (!$answer) { $answer="con_lost"; }
  218:     return $answer;
  219: }
  220: 
  221: sub reply {
  222:   my ($cmd,$server)=@_;
  223:   my $answer;
  224:   if ($server ne $perlvar{'lonHostID'}) { 
  225:     $answer=subreply($cmd,$server);
  226:     if ($answer eq 'con_lost') {
  227: 	$answer=subreply("ping",$server);
  228:         if ($answer ne $server) {
  229:            &reconlonc("$perlvar{'lonSockDir'}/$server");
  230:         }
  231:         $answer=subreply($cmd,$server);
  232:     }
  233:   } else {
  234:     $answer='self_reply';
  235:   } 
  236:   return $answer;
  237: }
  238: 
  239: # -------------------------------------------------------------- Talk to lonsql
  240: 
  241: sub sqlreply {
  242:     my ($cmd)=@_;
  243:     my $answer=subsqlreply($cmd);
  244:     if ($answer eq 'con_lost') { $answer=subsqlreply($cmd); }
  245:     return $answer;
  246: }
  247: 
  248: sub subsqlreply {
  249:     my ($cmd)=@_;
  250:     my $unixsock="mysqlsock";
  251:     my $peerfile="$perlvar{'lonSockDir'}/$unixsock";
  252:     my $sclient=IO::Socket::UNIX->new(Peer    =>"$peerfile",
  253:                                       Type    => SOCK_STREAM,
  254:                                       Timeout => 10)
  255:        or return "con_lost";
  256:     print $sclient "$cmd\n";
  257:     my $answer=<$sclient>;
  258:     chomp($answer);
  259:     if (!$answer) { $answer="con_lost"; }
  260:     return $answer;
  261: }
  262: 
  263: # -------------------------------------------- Return path to profile directory
  264: 
  265: sub propath {
  266:     my ($udom,$uname)=@_;
  267:     $udom=~s/\W//g;
  268:     $uname=~s/\W//g;
  269:     my $subdir=$uname.'__';
  270:     $subdir =~ s/(.)(.)(.).*/$1\/$2\/$3/;
  271:     my $proname="$perlvar{'lonUsersDir'}/$udom/$subdir/$uname";
  272:     return $proname;
  273: } 
  274: 
  275: # --------------------------------------- Is this the home server of an author?
  276: 
  277: sub ishome {
  278:     my $author=shift;
  279:     $author=~s/\/home\/httpd\/html\/res\/([^\/]*)\/([^\/]*).*/$1\/$2/;
  280:     my ($udom,$uname)=split(/\//,$author);
  281:     my $proname=propath($udom,$uname);
  282:     if (-e $proname) {
  283: 	return 'owner';
  284:     } else {
  285:         return 'not_owner';
  286:     }
  287: }
  288: 
  289: # ======================================================= Continue main program
  290: # ---------------------------------------------------- Fork once and dissociate
  291: 
  292: $fpid=fork;
  293: exit if $fpid;
  294: die "Couldn't fork: $!" unless defined ($fpid);
  295: 
  296: POSIX::setsid() or die "Can't start new session: $!";
  297: 
  298: # ------------------------------------------------------- Write our PID on disk
  299: 
  300: $execdir=$perlvar{'lonDaemons'};
  301: open (PIDSAVE,">$execdir/logs/lond.pid");
  302: print PIDSAVE "$$\n";
  303: close(PIDSAVE);
  304: &logthis("<font color=red>CRITICAL: ---------- Starting ----------</font>");
  305: 
  306: # ------------------------------------------------------- Now we are on our own
  307:     
  308: # Fork off our children.
  309: for (1 .. $PREFORK) {
  310:     make_new_child();
  311: }
  312: 
  313: # ----------------------------------------------------- Install signal handlers
  314: 
  315: $SIG{CHLD} = \&REAPER;
  316: $SIG{INT}  = $SIG{TERM} = \&HUNTSMAN;
  317: $SIG{HUP}  = \&HUPSMAN;
  318: 
  319: # And maintain the population.
  320: while (1) {
  321:     sleep;                          # wait for a signal (i.e., child's death)
  322:     for ($i = $children; $i < $PREFORK; $i++) {
  323:         make_new_child();           # top up the child pool
  324:     }
  325: }
  326: 
  327: sub make_new_child {
  328:     my $pid;
  329:     my $cipher;
  330:     my $sigset;
  331:     &logthis("Attempting to start child");    
  332:     # block signal for fork
  333:     $sigset = POSIX::SigSet->new(SIGINT);
  334:     sigprocmask(SIG_BLOCK, $sigset)
  335:         or die "Can't block SIGINT for fork: $!\n";
  336:     
  337:     die "fork: $!" unless defined ($pid = fork);
  338:     
  339:     if ($pid) {
  340:         # Parent records the child's birth and returns.
  341:         sigprocmask(SIG_UNBLOCK, $sigset)
  342:             or die "Can't unblock SIGINT for fork: $!\n";
  343:         $children{$pid} = 1;
  344:         $children++;
  345:         return;
  346:     } else {
  347:         # Child can *not* return from this subroutine.
  348:         $SIG{INT} = 'DEFAULT';      # make SIGINT kill us as it did before
  349:     
  350:         # unblock signals
  351:         sigprocmask(SIG_UNBLOCK, $sigset)
  352:             or die "Can't unblock SIGINT for fork: $!\n";
  353: 
  354:         $tmpsnum=0;
  355:     
  356:         # handle connections until we've reached $MAX_CLIENTS_PER_CHILD
  357:         for ($i=0; $i < $MAX_CLIENTS_PER_CHILD; $i++) {
  358:             $client = $server->accept()     or last;
  359: 
  360: # =============================================================================
  361:             # do something with the connection
  362: # -----------------------------------------------------------------------------
  363:             # see if we know client and check for spoof IP by challenge
  364:             my $caller=getpeername($client);
  365:             my ($port,$iaddr)=unpack_sockaddr_in($caller);
  366:             my $clientip=inet_ntoa($iaddr);
  367:             my $clientrec=($hostid{$clientip} ne undef);
  368:             &logthis(
  369: "<font color=yellow>INFO: Connect from $clientip ($hostid{$clientip})</font>");
  370:             my $clientok;
  371:             if ($clientrec) {
  372: 	      my $remotereq=<$client>;
  373:               $remotereq=~s/\W//g;
  374:               if ($remotereq eq 'init') {
  375: 		  my $challenge="$$".time;
  376:                   print $client "$challenge\n";
  377:                   $remotereq=<$client>;
  378:                   $remotereq=~s/\W//g;
  379:                   if ($challenge eq $remotereq) {
  380: 		      $clientok=1;
  381:                       print $client "ok\n";
  382:                   } else {
  383: 		      &logthis(
  384:  "<font color=blue>WARNING: $clientip did not reply challenge</font>");
  385:                       print $client "bye\n";
  386:                   }
  387:               } else {
  388: 		  &logthis(
  389:                     "<font color=blue>WARNING: "
  390:                    ."$clientip failed to initialize: >$remotereq< </font>");
  391: 		  print $client "bye\n";
  392:               }
  393: 	    } else {
  394:               &logthis(
  395:  "<font color=blue>WARNING: Unknown client $clientip</font>");
  396:               print $client "bye\n";
  397:             }
  398:             if ($clientok) {
  399: # ---------------- New known client connecting, could mean machine online again
  400: 	      &reconlonc("$perlvar{'lonSockDir'}/$hostid{$clientip}");
  401:               &logthis(
  402:        "<font color=green>Established connection: $hostid{$clientip}</font>");
  403: # ------------------------------------------------------------ Process requests
  404:               while (my $userinput=<$client>) {
  405:                 chomp($userinput);
  406:                 my $wasenc=0;
  407: # ------------------------------------------------------------ See if encrypted
  408: 		if ($userinput =~ /^enc/) {
  409: 		  if ($cipher) {
  410:                     my ($cmd,$cmdlength,$encinput)=split(/:/,$userinput);
  411: 		    $userinput='';
  412:                     for (my $encidx=0;$encidx<length($encinput);$encidx+=16) {
  413:                        $userinput.=
  414: 			   $cipher->decrypt(
  415:                             pack("H16",substr($encinput,$encidx,16))
  416:                            );
  417: 		    }
  418: 		    $userinput=substr($userinput,0,$cmdlength);
  419:                     $wasenc=1;
  420: 		  }
  421: 		}
  422: # ------------------------------------------------------------- Normal commands
  423: # ------------------------------------------------------------------------ ping
  424: 		   if ($userinput =~ /^ping/) {
  425:                        print $client "$perlvar{'lonHostID'}\n";
  426: # ------------------------------------------------------------------------ pong
  427: 		   } elsif ($userinput =~ /^pong/) {
  428:                        $reply=reply("ping",$hostid{$clientip});
  429:                        print $client "$perlvar{'lonHostID'}:$reply\n"; 
  430: # ------------------------------------------------------------------------ ekey
  431: 		   } elsif ($userinput =~ /^ekey/) {
  432:                        my $buildkey=time.$$.int(rand 100000);
  433:                        $buildkey=~tr/1-6/A-F/;
  434:                        $buildkey=int(rand 100000).$buildkey.int(rand 100000);
  435:                        my $key=$perlvar{'lonHostID'}.$hostid{$clientip};
  436:                        $key=~tr/a-z/A-Z/;
  437:                        $key=~tr/G-P/0-9/;
  438:                        $key=~tr/Q-Z/0-9/;
  439:                        $key=$key.$buildkey.$key.$buildkey.$key.$buildkey;
  440:                        $key=substr($key,0,32);
  441:                        my $cipherkey=pack("H32",$key);
  442:                        $cipher=new IDEA $cipherkey;
  443:                        print $client "$buildkey\n"; 
  444: # ------------------------------------------------------------------------ load
  445: 		   } elsif ($userinput =~ /^load/) {
  446:                        my $loadavg;
  447:                        {
  448:                           my $loadfile=IO::File->new('/proc/loadavg');
  449:                           $loadavg=<$loadfile>;
  450:                        }
  451:                        $loadavg =~ s/\s.*//g;
  452:                        my $loadpercent=100*$loadavg/$perlvar{'lonLoadLim'};
  453: 		       print $client "$loadpercent\n";
  454: # ------------------------------------------------------------------------ auth
  455:                    } elsif ($userinput =~ /^auth/) {
  456: 		     if ($wasenc==1) {
  457:                        my ($cmd,$udom,$uname,$upass)=split(/:/,$userinput);
  458:                        chomp($upass);
  459:                        $upass=unescape($upass);
  460:                        my $proname=propath($udom,$uname);
  461:                        my $passfilename="$proname/passwd";
  462:                        if (-e $passfilename) {
  463:                           my $pf = IO::File->new($passfilename);
  464:                           my $realpasswd=<$pf>;
  465:                           chomp($realpasswd);
  466:                           my ($howpwd,$contentpwd)=split(/:/,$realpasswd);
  467:                           my $pwdcorrect=0;
  468:                           if ($howpwd eq 'internal') {
  469: 			      $pwdcorrect=
  470: 				  (crypt($upass,$contentpwd) eq $contentpwd);
  471:                           } elsif ($howpwd eq 'unix') {
  472:                               $contentpwd=(getpwnam($uname))[1];
  473:                               $pwdcorrect=
  474:                                   (crypt($upass,$contentpwd) eq $contentpwd);
  475:                           } elsif ($howpwd eq 'krb4') {
  476:                               $pwdcorrect=(
  477:                                  Authen::Krb4::get_pw_in_tkt($uname,"",
  478:                                         $contentpwd,'krbtgt',$contentpwd,1,
  479: 							     $upass) == 0);
  480:                           } elsif ($howpwd eq 'localauth') {
  481: 			    $pwdcorrect=&localauth::localauth($uname,$upass,
  482: 							      $contentpwd);
  483: 			  }
  484:                           if ($pwdcorrect) {
  485:                              print $client "authorized\n";
  486:                           } else {
  487:                              print $client "non_authorized\n";
  488:                           }  
  489: 		       } else {
  490:                           print $client "unknown_user\n";
  491:                        }
  492: 		     } else {
  493: 		       print $client "refused\n";
  494: 		     }
  495: # ---------------------------------------------------------------------- passwd
  496:                    } elsif ($userinput =~ /^passwd/) {
  497: 		     if ($wasenc==1) {
  498:                        my 
  499:                        ($cmd,$udom,$uname,$upass,$npass)=split(/:/,$userinput);
  500:                        chomp($npass);
  501:                        $upass=&unescape($upass);
  502:                        $npass=&unescape($npass);
  503:                        my $proname=propath($udom,$uname);
  504:                        my $passfilename="$proname/passwd";
  505:                        if (-e $passfilename) {
  506: 			   my $realpasswd;
  507:                           { my $pf = IO::File->new($passfilename);
  508: 			    $realpasswd=<$pf>; }
  509:                           chomp($realpasswd);
  510:                           my ($howpwd,$contentpwd)=split(/:/,$realpasswd);
  511:                           if ($howpwd eq 'internal') {
  512: 			   if (crypt($upass,$contentpwd) eq $contentpwd) {
  513: 			     my $salt=time;
  514:                              $salt=substr($salt,6,2);
  515: 			     my $ncpass=crypt($npass,$salt);
  516:                              { my $pf = IO::File->new(">$passfilename");
  517:  	  		       print $pf "internal:$ncpass\n"; }             
  518:                              print $client "ok\n";
  519:                            } else {
  520:                              print $client "non_authorized\n";
  521:                            }
  522:                           } else {
  523:                             print $client "auth_mode_error\n";
  524:                           }  
  525: 		       } else {
  526:                           print $client "unknown_user\n";
  527:                        }
  528: 		     } else {
  529: 		       print $client "refused\n";
  530: 		     }
  531: # -------------------------------------------------------------------- makeuser
  532:                    } elsif ($userinput =~ /^makeuser/) {
  533: 		     if ($wasenc==1) {
  534:                        my 
  535:                        ($cmd,$udom,$uname,$umode,$npass)=split(/:/,$userinput);
  536:                        chomp($npass);
  537:                        $npass=&unescape($npass);
  538:                        my $proname=propath($udom,$uname);
  539:                        my $passfilename="$proname/passwd";
  540:                        if (-e $passfilename) {
  541: 			   print $client "already_exists\n";
  542:                        } elsif ($udom ne $perlvar{'lonDefDomain'}) {
  543:                            print $client "not_right_domain\n";
  544:                        } else {
  545:                            @fpparts=split(/\//,$proname);
  546:                            $fpnow=$fpparts[0].'/'.$fpparts[1].'/'.$fpparts[2];
  547:                            $fperror='';
  548:                            for ($i=3;$i<=$#fpparts;$i++) {
  549:                                $fpnow.='/'.$fpparts[$i]; 
  550:                                unless (-e $fpnow) {
  551: 				   unless (mkdir($fpnow,0777)) {
  552:                                       $fperror="error:$!\n";
  553:                                    }
  554:                                }
  555:                            }
  556:                            unless ($fperror) {
  557: 			     if ($umode eq 'krb4') {
  558:                                { 
  559:                                  my $pf = IO::File->new(">$passfilename");
  560:  	  		         print $pf "krb4:$npass\n"; 
  561:                                }             
  562:                                print $client "ok\n";
  563:                              } elsif ($umode eq 'internal') {
  564: 			       my $salt=time;
  565:                                $salt=substr($salt,6,2);
  566: 			       my $ncpass=crypt($npass,$salt);
  567:                                { 
  568:                                  my $pf = IO::File->new(">$passfilename");
  569:  	  		         print $pf "internal:$ncpass\n"; 
  570:                                }
  571:                                print $client "ok\n";
  572: 			     } elsif ($umode eq 'localauth') {
  573: 			       {
  574: 				 my $pf = IO::File->new(">$passfilename");
  575:   	  		         print $pf "localauth:$npass\n";
  576: 			       }
  577: 			       print $client "ok\n";
  578:                              } elsif ($umode eq 'none') {
  579:                                { 
  580:                                  my $pf = IO::File->new(">$passfilename");
  581:  	  		         print $pf "none:\n"; 
  582:                                }             
  583:                                print $client "ok\n";
  584:                              } else {
  585:                                print $client "auth_mode_error\n";
  586:                              }  
  587:                            } else {
  588:                                print $client "$fperror\n";
  589:                            }
  590:                        }
  591: 		     } else {
  592: 		       print $client "refused\n";
  593: 		     }
  594: # ------------------------------------------------------------------------ home
  595:                    } elsif ($userinput =~ /^home/) {
  596:                        my ($cmd,$udom,$uname)=split(/:/,$userinput);
  597:                        chomp($uname);
  598:                        my $proname=propath($udom,$uname);
  599:                        if (-e $proname) {
  600:                           print $client "found\n";
  601:                        } else {
  602: 			  print $client "not_found\n";
  603:                        }
  604: # ---------------------------------------------------------------------- update
  605:                    } elsif ($userinput =~ /^update/) {
  606:                        my ($cmd,$fname)=split(/:/,$userinput);
  607:                        my $ownership=ishome($fname);
  608:                        if ($ownership eq 'not_owner') {
  609:                         if (-e $fname) {
  610:                           my ($dev,$ino,$mode,$nlink,
  611:                               $uid,$gid,$rdev,$size,
  612:                               $atime,$mtime,$ctime,
  613:                               $blksize,$blocks)=stat($fname);
  614:                           $now=time;
  615:                           $since=$now-$atime;
  616:                           if ($since>$perlvar{'lonExpire'}) {
  617:                               $reply=
  618:                                     reply("unsub:$fname","$hostid{$clientip}");
  619:                               unlink("$fname");
  620:                           } else {
  621: 			     my $transname="$fname.in.transfer";
  622:                              my $remoteurl=
  623:                                     reply("sub:$fname","$hostid{$clientip}");
  624:                              my $response;
  625:                               {
  626:                              my $ua=new LWP::UserAgent;
  627:                              my $request=new HTTP::Request('GET',"$remoteurl");
  628:                              $response=$ua->request($request,$transname);
  629: 			      }
  630:                              if ($response->is_error()) {
  631: 				 unlink($transname);
  632:                                  my $message=$response->status_line;
  633:                                  &logthis(
  634:                                   "LWP GET: $message for $fname ($remoteurl)");
  635:                              } else {
  636: 	                         if ($remoteurl!~/\.meta$/) {
  637:                                   my $ua=new LWP::UserAgent;
  638:                                   my $mrequest=
  639:                                    new HTTP::Request('GET',$remoteurl.'.meta');
  640:                                   my $mresponse=
  641:                                    $ua->request($mrequest,$fname.'.meta');
  642:                                   if ($mresponse->is_error()) {
  643: 		                    unlink($fname.'.meta');
  644:                                   }
  645: 	                         }
  646:                                  rename($transname,$fname);
  647: 			     }
  648:                           }
  649:                           print $client "ok\n";
  650:                         } else {
  651:                           print $client "not_found\n";
  652:                         }
  653: 		       } else {
  654: 			print $client "rejected\n";
  655:                        }
  656: # ----------------------------------------------------------------- unsubscribe
  657:                    } elsif ($userinput =~ /^unsub/) {
  658:                        my ($cmd,$fname)=split(/:/,$userinput);
  659:                        if (-e $fname) {
  660:                            if (unlink("$fname.$hostid{$clientip}")) {
  661:                               print $client "ok\n";
  662: 			   } else {
  663:                               print $client "not_subscribed\n";
  664: 			   }
  665:                        } else {
  666: 			   print $client "not_found\n";
  667:                        }
  668: # ------------------------------------------------------------------- subscribe
  669:                    } elsif ($userinput =~ /^sub/) {
  670:                        my ($cmd,$fname)=split(/:/,$userinput);
  671:                        my $ownership=ishome($fname);
  672:                        if ($ownership eq 'owner') {
  673:                         if (-e $fname) {
  674: 			 if (-d $fname) {
  675: 			   print $client "directory\n";
  676:                          } else {
  677:                            $now=time;
  678:                            { 
  679: 			    my $sh;
  680:                             if ($sh=
  681:                              IO::File->new(">$fname.$hostid{$clientip}")) {
  682:                                print $sh "$clientip:$now\n";
  683: 			    }
  684: 			   }
  685:                            unless ($fname=~/\.meta$/) {
  686: 			       unlink("$fname.meta.$hostid{$clientip}");
  687:                            }
  688:                            $fname=~s/\/home\/httpd\/html\/res/raw/;
  689:                            $fname="http://$thisserver/".$fname;
  690:                            print $client "$fname\n";
  691: 		         }
  692:                         } else {
  693: 		      	   print $client "not_found\n";
  694:                         }
  695: 		       } else {
  696:                         print $client "rejected\n";
  697: 		       }
  698: # ------------------------------------------------------------------------- log
  699:                    } elsif ($userinput =~ /^log/) {
  700:                        my ($cmd,$udom,$uname,$what)=split(/:/,$userinput);
  701:                        chomp($what);
  702:                        my $proname=propath($udom,$uname);
  703:                        my $now=time;
  704:                        {
  705: 			 my $hfh;
  706: 			 if ($hfh=IO::File->new(">>$proname/activity.log")) { 
  707:                             print $hfh "$now:$hostid{$clientip}:$what\n";
  708:                             print $client "ok\n"; 
  709: 			} else {
  710:                             print $client "error:$!\n";
  711: 		        }
  712: 		       }
  713: # ------------------------------------------------------------------------- put
  714:                    } elsif ($userinput =~ /^put/) {
  715:                       my ($cmd,$udom,$uname,$namespace,$what)
  716:                           =split(/:/,$userinput);
  717:                       $namespace=~s/\//\_/g;
  718:                       $namespace=~s/\W//g;
  719:                       if ($namespace ne 'roles') {
  720:                        chomp($what);
  721:                        my $proname=propath($udom,$uname);
  722:                        my $now=time;
  723:                        unless ($namespace=~/^nohist\_/) {
  724: 			   my $hfh;
  725: 			   if (
  726:                              $hfh=IO::File->new(">>$proname/$namespace.hist")
  727: 			       ) { print $hfh "P:$now:$what\n"; }
  728: 		       }
  729:                        my @pairs=split(/\&/,$what);
  730:       if (tie(%hash,'GDBM_File',"$proname/$namespace.db",&GDBM_WRCREAT,0640)) {
  731:                            foreach $pair (@pairs) {
  732: 			       ($key,$value)=split(/=/,$pair);
  733:                                $hash{$key}=$value;
  734:                            }
  735: 			   if (untie(%hash)) {
  736:                               print $client "ok\n";
  737:                            } else {
  738:                               print $client "error:$!\n";
  739:                            }
  740:                        } else {
  741:                            print $client "error:$!\n";
  742:                        }
  743: 		      } else {
  744:                           print $client "refused\n";
  745:                       }
  746: # -------------------------------------------------------------------- rolesput
  747:                    } elsif ($userinput =~ /^rolesput/) {
  748: 		    if ($wasenc==1) {
  749:                        my ($cmd,$exedom,$exeuser,$udom,$uname,$what)
  750:                           =split(/:/,$userinput);
  751:                        my $namespace='roles';
  752:                        chomp($what);
  753:                        my $proname=propath($udom,$uname);
  754:                        my $now=time;
  755:                        {
  756: 			   my $hfh;
  757: 			   if (
  758:                              $hfh=IO::File->new(">>$proname/$namespace.hist")
  759: 			       ) { 
  760:                                   print $hfh "P:$now:$exedom:$exeuser:$what\n";
  761:                                  }
  762: 		       }
  763:                        my @pairs=split(/\&/,$what);
  764:       if (tie(%hash,'GDBM_File',"$proname/$namespace.db",&GDBM_WRCREAT,0640)) {
  765:                            foreach $pair (@pairs) {
  766: 			       ($key,$value)=split(/=/,$pair);
  767:                                $hash{$key}=$value;
  768:                            }
  769: 			   if (untie(%hash)) {
  770:                               print $client "ok\n";
  771:                            } else {
  772:                               print $client "error:$!\n";
  773:                            }
  774:                        } else {
  775:                            print $client "error:$!\n";
  776:                        }
  777: 		      } else {
  778:                           print $client "refused\n";
  779:                       }
  780: # ------------------------------------------------------------------------- get
  781:                    } elsif ($userinput =~ /^get/) {
  782:                        my ($cmd,$udom,$uname,$namespace,$what)
  783:                           =split(/:/,$userinput);
  784:                        $namespace=~s/\//\_/g;
  785:                        $namespace=~s/\W//g;
  786:                        chomp($what);
  787:                        my @queries=split(/\&/,$what);
  788:                        my $proname=propath($udom,$uname);
  789:                        my $qresult='';
  790:       if (tie(%hash,'GDBM_File',"$proname/$namespace.db",&GDBM_READER,0640)) {
  791:                            for ($i=0;$i<=$#queries;$i++) {
  792:                                $qresult.="$hash{$queries[$i]}&";
  793:                            }
  794: 			   if (untie(%hash)) {
  795: 		              $qresult=~s/\&$//;
  796:                               print $client "$qresult\n";
  797:                            } else {
  798:                               print $client "error:$!\n";
  799:                            }
  800:                        } else {
  801:                            print $client "error:$!\n";
  802:                        }
  803: # ------------------------------------------------------------------------ eget
  804:                    } elsif ($userinput =~ /^eget/) {
  805:                        my ($cmd,$udom,$uname,$namespace,$what)
  806:                           =split(/:/,$userinput);
  807:                        $namespace=~s/\//\_/g;
  808:                        $namespace=~s/\W//g;
  809:                        chomp($what);
  810:                        my @queries=split(/\&/,$what);
  811:                        my $proname=propath($udom,$uname);
  812:                        my $qresult='';
  813:       if (tie(%hash,'GDBM_File',"$proname/$namespace.db",&GDBM_READER,0640)) {
  814:                            for ($i=0;$i<=$#queries;$i++) {
  815:                                $qresult.="$hash{$queries[$i]}&";
  816:                            }
  817: 			   if (untie(%hash)) {
  818: 		              $qresult=~s/\&$//;
  819:                               if ($cipher) {
  820:                                 my $cmdlength=length($qresult);
  821:                                 $qresult.="         ";
  822:                                 my $encqresult='';
  823:                                 for 
  824: 				(my $encidx=0;$encidx<=$cmdlength;$encidx+=8) {
  825:                                  $encqresult.=
  826:                                  unpack("H16",
  827:                                  $cipher->encrypt(substr($qresult,$encidx,8)));
  828:                                 }
  829:                                 print $client "enc:$cmdlength:$encqresult\n";
  830: 			      } else {
  831: 			        print $client "error:no_key\n";
  832:                               }
  833:                            } else {
  834:                               print $client "error:$!\n";
  835:                            }
  836:                        } else {
  837:                            print $client "error:$!\n";
  838:                        }
  839: # ------------------------------------------------------------------------- del
  840:                    } elsif ($userinput =~ /^del/) {
  841:                        my ($cmd,$udom,$uname,$namespace,$what)
  842:                           =split(/:/,$userinput);
  843:                        $namespace=~s/\//\_/g;
  844:                        $namespace=~s/\W//g;
  845:                        chomp($what);
  846:                        my $proname=propath($udom,$uname);
  847:                        my $now=time;
  848:                        unless ($namespace=~/^nohist\_/) {
  849: 			   my $hfh;
  850: 			   if (
  851:                              $hfh=IO::File->new(">>$proname/$namespace.hist")
  852: 			       ) { print $hfh "D:$now:$what\n"; }
  853: 		       }
  854:                        my @keys=split(/\&/,$what);
  855:       if (tie(%hash,'GDBM_File',"$proname/$namespace.db",&GDBM_WRCREAT,0640)) {
  856:                            foreach $key (@keys) {
  857:                                delete($hash{$key});
  858:                            }
  859: 			   if (untie(%hash)) {
  860:                               print $client "ok\n";
  861:                            } else {
  862:                               print $client "error:$!\n";
  863:                            }
  864:                        } else {
  865:                            print $client "error:$!\n";
  866:                        }
  867: # ------------------------------------------------------------------------ keys
  868:                    } elsif ($userinput =~ /^keys/) {
  869:                        my ($cmd,$udom,$uname,$namespace)
  870:                           =split(/:/,$userinput);
  871:                        $namespace=~s/\//\_/g;
  872:                        $namespace=~s/\W//g;
  873:                        my $proname=propath($udom,$uname);
  874:                        my $qresult='';
  875:       if (tie(%hash,'GDBM_File',"$proname/$namespace.db",&GDBM_READER,0640)) {
  876:                            foreach $key (keys %hash) {
  877:                                $qresult.="$key&";
  878:                            }
  879: 			   if (untie(%hash)) {
  880: 		              $qresult=~s/\&$//;
  881:                               print $client "$qresult\n";
  882:                            } else {
  883:                               print $client "error:$!\n";
  884:                            }
  885:                        } else {
  886:                            print $client "error:$!\n";
  887:                        }
  888: # ------------------------------------------------------------------------ dump
  889:                    } elsif ($userinput =~ /^dump/) {
  890:                        my ($cmd,$udom,$uname,$namespace)
  891:                           =split(/:/,$userinput);
  892:                        $namespace=~s/\//\_/g;
  893:                        $namespace=~s/\W//g;
  894:                        my $proname=propath($udom,$uname);
  895:                        my $qresult='';
  896:       if (tie(%hash,'GDBM_File',"$proname/$namespace.db",&GDBM_READER,0640)) {
  897:                            foreach $key (keys %hash) {
  898:                                $qresult.="$key=$hash{$key}&";
  899:                            }
  900: 			   if (untie(%hash)) {
  901: 		              $qresult=~s/\&$//;
  902:                               print $client "$qresult\n";
  903:                            } else {
  904:                               print $client "error:$!\n";
  905:                            }
  906:                        } else {
  907:                            print $client "error:$!\n";
  908:                        }
  909: # ----------------------------------------------------------------------- store
  910:                    } elsif ($userinput =~ /^store/) {
  911:                       my ($cmd,$udom,$uname,$namespace,$rid,$what)
  912:                           =split(/:/,$userinput);
  913:                       $namespace=~s/\//\_/g;
  914:                       $namespace=~s/\W//g;
  915:                       if ($namespace ne 'roles') {
  916:                        chomp($what);
  917:                        my $proname=propath($udom,$uname);
  918:                        my $now=time;
  919:                        unless ($namespace=~/^nohist\_/) {
  920: 			   my $hfh;
  921: 			   if (
  922:                              $hfh=IO::File->new(">>$proname/$namespace.hist")
  923: 			       ) { print $hfh "P:$now:$rid:$what\n"; }
  924: 		       }
  925:                        my @pairs=split(/\&/,$what);
  926:                          
  927:     if (tie(%hash,'GDBM_File',"$proname/$namespace.db",&GDBM_WRCREAT,0640)) {
  928:                            my @previouskeys=split(/&/,$hash{"keys:$rid"});
  929:                            my $key;
  930:                            $hash{"version:$rid"}++;
  931:                            my $version=$hash{"version:$rid"};
  932:                            my $allkeys=''; 
  933:                            foreach $pair (@pairs) {
  934: 			       ($key,$value)=split(/=/,$pair);
  935:                                $allkeys.=$key.':';
  936:                                $hash{"$version:$rid:$key"}=$value;
  937:                            }
  938:                            $hash{"$version:$rid:timestamp"}=$now;
  939:                            $allkeys.='timestamp';
  940:                            $hash{"$version:keys:$rid"}=$allkeys;
  941: 			   if (untie(%hash)) {
  942:                               print $client "ok\n";
  943:                            } else {
  944:                               print $client "error:$!\n";
  945:                            }
  946:                        } else {
  947:                            print $client "error:$!\n";
  948:                        }
  949: 		      } else {
  950:                           print $client "refused\n";
  951:                       }
  952: # --------------------------------------------------------------------- restore
  953:                    } elsif ($userinput =~ /^restore/) {
  954:                        my ($cmd,$udom,$uname,$namespace,$rid)
  955:                           =split(/:/,$userinput);
  956:                        $namespace=~s/\//\_/g;
  957:                        $namespace=~s/\W//g;
  958:                        chomp($rid);
  959:                        my $proname=propath($udom,$uname);
  960:                        my $qresult='';
  961:       if (tie(%hash,'GDBM_File',"$proname/$namespace.db",&GDBM_READER,0640)) {
  962:                 	   my $version=$hash{"version:$rid"};
  963:                            $qresult.="version=$version&";
  964:                            my $scope;
  965:                            for ($scope=1;$scope<=$version;$scope++) {
  966: 			      my $vkeys=$hash{"$scope:keys:$rid"};
  967:                               my @keys=split(/:/,$vkeys);
  968:                               my $key;
  969:                               $qresult.="$scope:keys=$vkeys&";
  970:                               foreach $key (@keys) {
  971: 	     $qresult.="$scope:$key=".$hash{"$scope:$rid:$key"}."&";
  972:                               }                                  
  973:                            }
  974: 			   if (untie(%hash)) {
  975: 		              $qresult=~s/\&$//;
  976:                               print $client "$qresult\n";
  977:                            } else {
  978:                               print $client "error:$!\n";
  979:                            }
  980:                        } else {
  981:                            print $client "error:$!\n";
  982:                        }
  983: # ------------------------------------------------------------------- querysend
  984:                    } elsif ($userinput =~ /^querysend/) {
  985:                        my ($cmd,$query,
  986: 			   $custom,$customshow)=split(/:/,$userinput);
  987: 		       $query=~s/\n*$//g;
  988: 		       unless ($custom or $customshow) {
  989: 			   print $client "".
  990: 			       sqlreply("$hostid{$clientip}\&$query")."\n";
  991: 		       }
  992: 		       else {
  993: 			   print $client "".
  994: 			       sqlreply("$hostid{$clientip}\&$query".
  995: 					"\&$custom"."\&$customshow")."\n";
  996: 		       }
  997: # ------------------------------------------------------------------ queryreply
  998:                    } elsif ($userinput =~ /^queryreply/) {
  999:                        my ($cmd,$id,$reply)=split(/:/,$userinput); 
 1000: 		       my $store;
 1001:                        my $execdir=$perlvar{'lonDaemons'};
 1002:                        if ($store=IO::File->new(">$execdir/tmp/$id")) {
 1003: 			   $reply=~s/\&/\n/g;
 1004: 			   print $store $reply;
 1005: 			   close $store;
 1006: 			   my $store2=IO::File->new(">$execdir/tmp/$id.end");
 1007: 			   print $store2 "done\n";
 1008: 			   close $store2;
 1009: 			   print $client "ok\n";
 1010: 		       }
 1011: 		       else {
 1012: 			   print $client "error:$!\n";
 1013: 		       }
 1014: # ----------------------------------------------------------------------- idput
 1015:                    } elsif ($userinput =~ /^idput/) {
 1016:                        my ($cmd,$udom,$what)=split(/:/,$userinput);
 1017:                        chomp($what);
 1018:                        $udom=~s/\W//g;
 1019:                        my $proname="$perlvar{'lonUsersDir'}/$udom/ids";
 1020:                        my $now=time;
 1021:                        {
 1022: 			   my $hfh;
 1023: 			   if (
 1024:                              $hfh=IO::File->new(">>$proname.hist")
 1025: 			       ) { print $hfh "P:$now:$what\n"; }
 1026: 		       }
 1027:                        my @pairs=split(/\&/,$what);
 1028:                  if (tie(%hash,'GDBM_File',"$proname.db",&GDBM_WRCREAT,0640)) {
 1029:                            foreach $pair (@pairs) {
 1030: 			       ($key,$value)=split(/=/,$pair);
 1031:                                $hash{$key}=$value;
 1032:                            }
 1033: 			   if (untie(%hash)) {
 1034:                               print $client "ok\n";
 1035:                            } else {
 1036:                               print $client "error:$!\n";
 1037:                            }
 1038:                        } else {
 1039:                            print $client "error:$!\n";
 1040:                        }
 1041: # ----------------------------------------------------------------------- idget
 1042:                    } elsif ($userinput =~ /^idget/) {
 1043:                        my ($cmd,$udom,$what)=split(/:/,$userinput);
 1044:                        chomp($what);
 1045:                        $udom=~s/\W//g;
 1046:                        my $proname="$perlvar{'lonUsersDir'}/$udom/ids";
 1047:                        my @queries=split(/\&/,$what);
 1048:                        my $qresult='';
 1049:                  if (tie(%hash,'GDBM_File',"$proname.db",&GDBM_READER,0640)) {
 1050:                            for ($i=0;$i<=$#queries;$i++) {
 1051:                                $qresult.="$hash{$queries[$i]}&";
 1052:                            }
 1053: 			   if (untie(%hash)) {
 1054: 		              $qresult=~s/\&$//;
 1055:                               print $client "$qresult\n";
 1056:                            } else {
 1057:                               print $client "error:$!\n";
 1058:                            }
 1059:                        } else {
 1060:                            print $client "error:$!\n";
 1061:                        }
 1062: # ---------------------------------------------------------------------- tmpput
 1063:                    } elsif ($userinput =~ /^tmpput/) {
 1064:                        my ($cmd,$what)=split(/:/,$userinput);
 1065: 		       my $store;
 1066:                        $tmpsnum++;
 1067:                        my $id=$$.'_'.$clientip.'_'.$tmpsnum;
 1068:                        $id=~s/\W/\_/g;
 1069:                        $what=~s/\n//g;
 1070:                        my $execdir=$perlvar{'lonDaemons'};
 1071:                        if ($store=IO::File->new(">$execdir/tmp/$id.tmp")) {
 1072: 			   print $store $what;
 1073: 			   close $store;
 1074: 			   print $client "$id\n";
 1075: 		       }
 1076: 		       else {
 1077: 			   print $client "error:$!\n";
 1078: 		       }
 1079: 
 1080: # ---------------------------------------------------------------------- tmpget
 1081:                    } elsif ($userinput =~ /^tmpget/) {
 1082:                        my ($cmd,$id)=split(/:/,$userinput);
 1083:                        chomp($id);
 1084:                        $id=~s/\W/\_/g;
 1085:                        my $store;
 1086:                        my $execdir=$perlvar{'lonDaemons'};
 1087:                        if ($store=IO::File->new("$execdir/tmp/$id.tmp")) {
 1088:                            my $reply=<$store>;
 1089: 			   print $client "$reply\n";
 1090:                            close $store;
 1091: 		       }
 1092: 		       else {
 1093: 			   print $client "error:$!\n";
 1094: 		       }
 1095: 
 1096: # -------------------------------------------------------------------------- ls
 1097:                    } elsif ($userinput =~ /^ls/) {
 1098:                        my ($cmd,$ulsdir)=split(/:/,$userinput);
 1099:                        my $ulsout='';
 1100:                        my $ulsfn;
 1101:                        if (-e $ulsdir) {
 1102: 			if (opendir(LSDIR,$ulsdir)) {
 1103:                           while ($ulsfn=readdir(LSDIR)) {
 1104: 			     my @ulsstats=stat($ulsdir.'/'.$ulsfn);
 1105:                              $ulsout.=$ulsfn.'&'.join('&',@ulsstats).':';
 1106:                           }
 1107:                           closedir(LSDIR);
 1108: 		        }
 1109: 		       } else {
 1110:                           $ulsout='no_such_dir';
 1111:                        }
 1112:                        if ($ulsout eq '') { $ulsout='empty'; }
 1113:                        print $client "$ulsout\n";
 1114: # ------------------------------------------------------------- unknown command
 1115:                    } else {
 1116:                        # unknown command
 1117:                        print $client "unknown_cmd\n";
 1118:                    }
 1119: # ------------------------------------------------------ client unknown, refuse
 1120: 	       }
 1121:             } else {
 1122: 	        print $client "refused\n";
 1123:                 &logthis("<font color=blue>WARNING: "
 1124:                 ."Rejected client $clientip, closing connection</font>");
 1125:             }              
 1126:             &logthis("<font color=red>CRITICAL: "
 1127:                     ."Disconnect from $clientip ($hostid{$clientip})</font>");
 1128: # =============================================================================
 1129:         }
 1130:     
 1131:         # tidy up gracefully and finish
 1132:     
 1133:         # this exit is VERY important, otherwise the child will become
 1134:         # a producer of more and more children, forking yourself into
 1135:         # process death.
 1136:         exit;
 1137:     }
 1138: }
 1139: 
 1140: 
 1141: 
 1142: 
 1143: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>