--- loncom/lond 2008/04/16 22:51:21 1.399 +++ loncom/lond 2008/04/21 15:27:34 1.400 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.399 2008/04/16 22:51:21 raeburn Exp $ +# $Id: lond,v 1.400 2008/04/21 15:27:34 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -59,7 +59,7 @@ my $DEBUG = 0; # Non zero to ena my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.399 $'; #' stupid emacs +my $VERSION='$Revision: 1.400 $'; #' stupid emacs my $remoteVERSION; my $currenthostid="default"; my $currentdomainid; @@ -1535,11 +1535,15 @@ sub ls3_handler { &Failure($client,"refused\n","$cmd:$tail"); return 1; } - } elsif (defined($alternate_root)) { + } elsif ($alternate_root ne '') { $dir_root = $alternate_root; } - if (defined($dir_root)) { - $ulsdir = $dir_root.'/'.$ulsdir; + if ($dir_root ne '') { + if ($ulsdir =~ /^\//) { + $ulsdir = $dir_root.$ulsdir; + } else { + $ulsdir = $dir_root.'/'.$ulsdir; + } } my $obs; my $rights; @@ -1576,10 +1580,10 @@ sub ls3_handler { } } else { $ulsout='no_such_dir'; - } - if ($ulsout eq '') { $ulsout='empty'; } - &Reply($client, \$ulsout, $userinput); # This supports debug logging. - return 1; + } + if ($ulsout eq '') { $ulsout='empty'; } + &Reply($client, \$ulsout, $userinput); # This supports debug logging. + return 1; } ®ister_handler("ls3", \&ls3_handler, 0, 1, 0);