[LON-CAPA-cvs] cvs: loncom / lond

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Mon, 21 Apr 2008 15:27:35 -0000


raeburn		Mon Apr 21 11:27:35 2008 EDT

  Modified files:              
    /loncom	lond 
  Log:
  ls3_handler modifications 
  - replace check for alternate_root defined, with check it is not ''.
  - $dir_root is prepended to $ulsdir if it is not '' and add a '/' between if needed. 
  
  
Index: loncom/lond
diff -u loncom/lond:1.399 loncom/lond:1.400
--- loncom/lond:1.399	Wed Apr 16 18:51:21 2008
+++ loncom/lond	Mon Apr 21 11:27:34 2008
@@ -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 $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 @@
             &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 @@
         }
     } 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;
 }
 &register_handler("ls3", \&ls3_handler, 0, 1, 0);