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

raeburn raeburn at source.lon-capa.org
Fri Jul 10 22:52:53 EDT 2026


raeburn		Sat Jul 11 02:52:53 2026 EDT

  Modified files:              
    /loncom	lond 
  Log:
  - Remove trailing whitespace.  No code changes.
  
  
-------------- next part --------------
Index: loncom/lond
diff -u loncom/lond:1.588 loncom/lond:1.589
--- loncom/lond:1.588	Sat Jul 11 02:51:06 2026
+++ loncom/lond	Sat Jul 11 02:52:53 2026
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.588 2026/07/11 02:51:06 raeburn Exp $
+# $Id: lond,v 1.589 2026/07/11 02:52:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -10,7 +10,7 @@
 #
 # LON-CAPA is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or 
+# the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
 # LON-CAPA is distributed in the hope that it will be useful,
@@ -65,7 +65,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.588 $'; #' stupid emacs
+my $VERSION='$Revision: 1.589 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -74,11 +74,11 @@
 my $clientip;			# IP address of client.
 my $clientname;			# LonCAPA name of client.
 my $clientversion;              # LonCAPA version running on client.
-my $clienthomedom;              # LonCAPA domain of homeID for client. 
+my $clienthomedom;              # LonCAPA domain of homeID for client.
 my $clientintdom;               # LonCAPA "internet domain" for client.
-my $clientsamedom;              # LonCAPA domain same for this host 
+my $clientsamedom;              # LonCAPA domain same for this host
                                 # and client.
-my $clientsameinst;             # LonCAPA "internet domain" same for 
+my $clientsameinst;             # LonCAPA "internet domain" same for
                                 # this host and client.
 my $clientremoteok;             # Current domain permits hosting on client
                                 # (not set if host and client share "internet domain").
@@ -93,7 +93,7 @@
 my $cipher;			# Cipher key negotiated with client
 my $tmpsnum = 0;		# Id of tmpputs.
 
-# 
+#
 #   Connection type is:
 #      client                   - All client actions are allowed
 #      manager                  - only management functions allowed.
@@ -106,7 +106,7 @@
 
 my %perlvar;			# Will have the apache conf defined perl vars.
 
-my %secureconf;                 # Will have requirements for security 
+my %secureconf;                 # Will have requirements for security
                                 # of lond connections
 
 my %crlchecked;                 # Will contain clients for which the client's SSL
@@ -144,7 +144,7 @@
 		   "pwchange_failure - lcpasswd Cannot set new passwd.",
 		   "pwchange_failure - lcpasswd Username has invalid characters",
 		   "pwchange_failure - lcpasswd Invalid characters in password",
-		   "pwchange_failure - lcpasswd User already exists", 
+		   "pwchange_failure - lcpasswd User already exists",
                    "pwchange_failure - lcpasswd Something went wrong with user addition.",
 		   "pwchange_failure - lcpasswd Password mismatch",
 		   "pwchange_failure - lcpasswd Error filename is invalid");
@@ -162,7 +162,7 @@
 		     );
 
 #
-# The %trust hash classifies commands according to type of trust 
+# The %trust hash classifies commands according to type of trust
 # required for execution of the command.
 #
 # When clients from a different institution request execution of a
@@ -182,13 +182,13 @@
 # catalog   ("Course Catalog for this domain displayed elsewhere")
 # reqcrs    ("Requests for creation of courses in this domain by others")
 # msg       ("Users in other domains can send messages to this domain")
-# 
-# Trust type which depends on the User Session Hosting (remote) 
+#
+# Trust type which depends on the User Session Hosting (remote)
 # domain configuration for machine's default domain is: "remote".
 #
-# Trust types which depend on contents of manager.tab in 
+# Trust types which depend on contents of manager.tab in
 # /home/httpd/lonTabs is: "manageronly".
-# 
+#
 # Trust type which requires client to share the same LON-CAPA
 # "internet domain" (i.e., same institution as this server) is:
 # "institutiononly".
@@ -260,7 +260,7 @@
                instidrules => {remote => 1, domroles => 1,},
                instrulecheck => {remote => 1, enroll => 1, reqcrs => 1, domroles => 1},
                instselfcreatecheck => {institutiononly => 1},
-               instunamemapcheck => {remote => 1,},  
+               instunamemapcheck => {remote => 1,},
                instuserrules => {remote => 1, enroll => 1, reqcrs => 1, domroles => 1},
                keys => {remote => 1,},
                load => {anywhere => 1},
@@ -332,7 +332,7 @@
 my $Transactions = 0;		# Number of attempted transactions.
 my $Failures     = 0;		# Number of transcations failed.
 
-#   ResetStatistics: 
+#   ResetStatistics:
 #      Resets the statistics counters:
 #
 sub ResetStatistics {
@@ -419,7 +419,7 @@
 	$Certificate) = lonssl::CertificateFile();
 
 
-    # If any of the key, certificate or certificate authority 
+    # If any of the key, certificate or certificate authority
     # certificate filenames are not defined, this can't work.
 
     if((!$Certificate) || (!$CACertificate)) {
@@ -460,21 +460,21 @@
     }
     Debug("SSL Promotion successful");
 
-    # 
+    #
     #  The only thing we'll use the socket for is to send the IDEA key
     #  to the peer:
 
     my $Key = lonlocal::CreateCipherKey();
     print $SSLSocket "$Key\n";
 
-    lonssl::Close($SSLSocket); 
+    lonssl::Close($SSLSocket);
 
     Debug("Key exchange complete: $Key");
 
     return $Key;
 }
 #
-#     InsecureConnection: 
+#     InsecureConnection:
 #        If insecure connections are allowd,
 #        exchange a challenge with the client to 'validate' the
 #        client (not really, but that's the protocol):
@@ -497,7 +497,7 @@
         if ($clientsamedom) {
             if ($secureconf{'connfrom'}{'dom'} eq 'req') {
                 return 0;
-            } 
+            }
         } elsif ($clientsameinst) {
             if ($secureconf{'connfrom'}{'intdom'} eq 'req') {
                 return 0;
@@ -526,7 +526,7 @@
 	&status("No challenge reqply");
 	return 0;
     }
-    
+
 
 }
 #
@@ -547,7 +547,7 @@
     my $output    = "";
 
     my $pid = open(CHILD, "-|");
-    
+
     if($pid) {			# Parent process
 	Debug("In parent process for execute_command");
 	my @data = <CHILD>;	# Read the child's outupt...
@@ -633,7 +633,7 @@
 	    #  hostname- The dns name of the host.
 	    #
           my($cluname, $dnsname) = split(/:/, $host);
-          
+
           my $ip = gethostbyname($dnsname);
           if(defined($ip)) {                 # bad names don't deserve entry.
             my $hostip = inet_ntoa($ip);
@@ -654,14 +654,14 @@
 #                just the connecting loncapa client name.  This is checked
 #                against a valid client list in the configuration.
 #
-#                  
+#
 sub ValidManager {
-    my $certificate = shift; 
+    my $certificate = shift;
 
     return isManager;
 }
 #
-#  CopyFile:  Called as part of the process of installing a 
+#  CopyFile:  Called as part of the process of installing a
 #             new configuration file.  This function copies an existing
 #             file to a backup file.
 # Parameters:
@@ -683,14 +683,14 @@
 }
 #
 #  Host files are passed out with externally visible host IPs.
-#  If, for example, we are behind a fire-wall or NAT host, our 
+#  If, for example, we are behind a fire-wall or NAT host, our
 #  internally visible IP may be different than the externally
 #  visible IP.  Therefore, we always adjust the contents of the
 #  host file so that the entry for ME is the IP that we believe
 #  we have.  At present, this is defined as the entry that
 #  DNS has for us.  If by some chance we are not able to get a
 #  DNS translation for us, then we assume that the host.tab file
-#  is correct.  
+#  is correct.
 #    BUGBUGBUG - in the future, we really should see if we can
 #       easily query the interface(s) instead.
 # Parameter(s):
@@ -762,7 +762,7 @@
     }
     #  write the contents of the file:
 
-    print $fh ($Contents); 
+    print $fh ($Contents);
     $fh->close;			# In case we ever have a filesystem w. locking
 
     chmod(0664, $TempFile);	# Everyone can write it.
@@ -794,8 +794,8 @@
 #
 #   ConfigFileFromSelector: converts a configuration file selector
 #                 into a configuration file pathname.
-#                 Supports the following file selectors: 
-#                 hosts, domain, dns_hosts, dns_domain  
+#                 Supports the following file selectors:
+#                 hosts, domain, dns_hosts, dns_domain
 #
 #
 #  Parameters:
@@ -814,7 +814,7 @@
         }
     } else {
         my $tabledir = $perlvar{'lonTabDir'}.'/';
-        if (($selector eq "hosts") || ($selector eq "domain") || 
+        if (($selector eq "hosts") || ($selector eq "domain") ||
             ($selector eq "dns_hosts") || ($selector eq "dns_domain")) {
 	    $tablefile =  $tabledir.$selector.'.tab';
         }
@@ -840,7 +840,7 @@
     my $request = shift;
     my ($command, $filename, $contents) = split(":", $request, 3);
     &Debug("PushFile");
-    
+
     #  At this point in time, pushes for only the following tables and
     #  CRL file are supported:
     #   hosts.tab  ($filename eq host).
@@ -862,7 +862,7 @@
 
     #  If the file being pushed is the host file, we adjust the entry for ourself so that the
     #  IP will be our current IP as looked up in dns.  Note this is only 99% good as it's possible
-    #  to conceive of conditions where we don't have a DNS entry locally.  This is possible in a 
+    #  to conceive of conditions where we don't have a DNS entry locally.  This is possible in a
     #  network sense but it doesn't make much sense in a LonCAPA sense so we ignore (for now)
     #  that possibilty.
 
@@ -947,7 +947,7 @@
     }
 
     #  Indicate success:
- 
+
     return "ok";
 
 }
@@ -957,8 +957,8 @@
 #
 #  Parameters:
 #    request   - The full request by the client.  This is of the form
-#                reinit:<process>  
-#                where <process> is allowed to be either of 
+#                reinit:<process>
+#                where <process> is allowed to be either of
 #                lonc or lond
 #
 #  Returns:
@@ -1019,7 +1019,7 @@
     my ($command, $key, $newline)  = split(/\|/, $scriptline);
     &logthis('<font color="green"> isValideditCommand checking: '.
 	     "Command = '$command', Key = '$key', Newline = '$newline' </font>\n");
-    
+
     if ($command eq "delete") {
 	#
 	#   key with no newline.
@@ -1050,11 +1050,11 @@
     return 0;			# Should not get here!!!
 }
 #
-#   ApplyEdit - Applies an edit command to a line in a configuration 
+#   ApplyEdit - Applies an edit command to a line in a configuration
 #               file.  It is the caller's responsiblity to validate the
 #               edit line.
 #   Parameters:
-#      $directive - A single edit directive to apply.  
+#      $directive - A single edit directive to apply.
 #                   Edit directives are of the form:
 #                  append|newline      - Appends a new line to the file.
 #                  replace|key|newline - Replaces the line with key value 'key'
@@ -1128,7 +1128,7 @@
     #  Replace the line:
 
     $editor->ReplaceLine($id, $newConfigLine);
-    
+
 }
 #
 #   ReplaceConfigFile:
@@ -1146,7 +1146,7 @@
 #        editor     - Editor containing the file.
 #
 sub ReplaceConfigFile {
-    
+
     my ($filename, $editor) = @_;
 
     CopyFile ($filename, $filename.".old");
@@ -1155,7 +1155,7 @@
 
     InstallFile($filename, $contents);
 }
-#   
+#
 #
 #   Called to edit a configuration table  file
 #   Parameters:
@@ -1192,7 +1192,7 @@
     }
 
     #   Execute the edit operation.
-    #   - Create a config file editor for the appropriate file and 
+    #   - Create a config file editor for the appropriate file and
     #   - execute each command in the script:
     #
     my $configfile = ConfigFileFromSelector($filetype);
@@ -1236,13 +1236,13 @@
 #
 sub read_profile {
     my ($udom, $uname, $namespace, $what) = @_;
-    
+
     my $hashref = &tie_user_hash($udom, $uname, $namespace,
 				 &GDBM_READER());
     if ($hashref) {
         my @queries=split(/\&/,$what);
         if ($namespace eq 'roles') {
-            @queries = map { &unescape($_); } @queries; 
+            @queries = map { &unescape($_); } @queries;
         }
         my $qresult='';
 	
@@ -1266,7 +1266,7 @@
 }
 #--------------------- Request Handlers --------------------------------------------
 #
-#   By convention each request handler registers itself prior to the sub 
+#   By convention each request handler registers itself prior to the sub
 #   declaration:
 #
 
@@ -1288,9 +1288,9 @@
 sub ping_handler {
     my ($cmd, $tail, $client) = @_;
     Debug("$cmd $tail $client .. $currenthostid:");
-   
+
     Reply( $client,\$currenthostid,"$cmd:$tail");
-   
+
     return 1;
 }
 &register_handler("ping", \&ping_handler, 0, 1, 1);       # Ping unencoded, client or manager.
@@ -1316,7 +1316,7 @@
     my ($cmd, $tail, $replyfd) = @_;
 
     my $reply=&Apache::lonnet::reply("ping",$clientname);
-    &Reply( $replyfd, "$currenthostid:$reply\n", "$cmd:$tail"); 
+    &Reply( $replyfd, "$currenthostid:$reply\n", "$cmd:$tail");
     return 1;
 }
 &register_handler("pong", \&pong_handler, 0, 1, 1);       # Pong unencoded, client or manager
@@ -1359,8 +1359,8 @@
     $key=substr($key,0,32);
     my $cipherkey=pack("H32",$key);
     $cipher=new IDEA $cipherkey;
-    &Reply($replyfd, \$buildkey, "$cmd:$tail"); 
-   
+    &Reply($replyfd, \$buildkey, "$cmd:$tail");
+
     return 1;
 
 }
@@ -1395,13 +1395,13 @@
     if ($loadfile=IO::File->new('/proc/loadavg')) {
         $loadavg=<$loadfile>;
         $loadavg =~ s/\s.*//g;                      # Extract the first field only.
-        $loadfile->close; 
+        $loadfile->close;
     }
 
     my $loadpercent=100*$loadavg/$perlvar{'lonLoadLim'};
 
     &Reply( $replyfd, \$loadpercent, "$cmd:$tail");
-   
+
     return 1;
 }
 &register_handler("load", \&load_handler, 0, 1, 0);
@@ -1431,7 +1431,7 @@
 
     my $userloadpercent=&Apache::lonnet::userload();
     &Reply($replyfd, \$userloadpercent, "$cmd:$tail");
-    
+
     return 1;
 }
 &register_handler("userload", \&user_load_handler, 0, 1, 0);
@@ -1451,12 +1451,12 @@
 #
 sub user_authorization_type {
     my ($cmd, $tail, $replyfd) = @_;
-   
+
     my $userinput = "$cmd:$tail";
-   
+
     #  Pull the domain and username out of the command tail.
     # and call get_auth_type to determine the authentication type.
-   
+
     my ($udom,$uname)=split(/:/,$tail);
     my $result = &get_auth_type($udom, $uname);
     if($result eq "nouser") {
@@ -1475,12 +1475,12 @@
         }
 	&Reply( $replyfd, \$type, $userinput);
     }
-  
+
     return 1;
 }
 &register_handler("currentauth", \&user_authorization_type, 1, 1, 0);
 
-#   Process a request by a manager to push a hosts or domain table 
+#   Process a request by a manager to push a hosts or domain table
 #   to us.  We pick apart the command and pass it on to the subs
 #   that already exist to do this.
 #
@@ -1508,14 +1508,14 @@
 
 	# Now presumably we have the bona fides of both the peer host and the
 	# process making the request.
-      
+
 	my $reply = &PushFile($userinput);
 	&Reply($client, \$reply, $userinput);
 
     } else {
 	&logthis("push_file_handler $client is not valid");
 	&Failure( $client, "refused\n", $userinput);
-    } 
+    }
     return 1;
 }
 &register_handler("pushfile", \&push_file_handler, 1, 0, 1);
@@ -1523,10 +1523,10 @@
 # The du_handler routine should be considered obsolete and is retained
 # for communication with legacy servers.  Please see the du2_handler.
 #
-#   du  - list the disk usage of a directory recursively. 
-#    
+#   du  - list the disk usage of a directory recursively.
+#
 #   note: stolen code from the ls file handler
-#   under construction by Rick Banghart 
+#   under construction by Rick Banghart
 #    .
 # Parameters:
 #    $cmd        - The command that dispatched us (du).
@@ -1556,8 +1556,8 @@
     #
     if (-d $ududir) {
 	my $total_size=0;
-	my $code=sub { 
-	    if ($_=~/\.\d+\./) { return;} 
+	my $code=sub {
+	    if ($_=~/\.\d+\./) { return;}
 	    if ($_=~/\.meta$/) { return;}
 	    if (-d $_)         { return;}
 	    $total_size+=(stat($_))[7];
@@ -1567,15 +1567,15 @@
 	$total_size=int($total_size/1024);
 	&Reply($client,\$total_size,"$cmd:$ududir");
     } else {
-	&Failure($client, "bad_directory:$ududir\n","$cmd:$ududir"); 
+	&Failure($client, "bad_directory:$ududir\n","$cmd:$ududir");
     }
     return 1;
 }
 &register_handler("du", \&du_handler, 0, 1, 0);
 
-# Please also see the du_handler, which is obsoleted by du2. 
+# Please also see the du_handler, which is obsoleted by du2.
 # du2_handler differs from du_handler in that required path to directory
-# provided by &propath() is prepended in the handler instead of on the 
+# provided by &propath() is prepended in the handler instead of on the
 # client side.
 #
 #   du2  - list the disk usage of a directory recursively.
@@ -1696,14 +1696,14 @@
 	    if (opendir(LSDIR,$ulsdir)) {
 		while ($ulsfn=readdir(LSDIR)) {
 		    undef($obs);
-		    undef($rights); 
+		    undef($rights);
 		    my @ulsstats=stat($ulsdir.'/'.$ulsfn);
 		    #We do some obsolete checking here
-		    if(-e $ulsdir.'/'.$ulsfn.".meta") { 
+		    if(-e $ulsdir.'/'.$ulsfn.".meta") {
 			open(FILE, $ulsdir.'/'.$ulsfn.".meta");
 			my @obsolete=<FILE>;
 			foreach my $obsolete (@obsolete) {
-			    if($obsolete =~ m/(<obsolete>)(on|1)/) { $obs = 1; } 
+			    if($obsolete =~ m/(<obsolete>)(on|1)/) { $obs = 1; }
 			    if($obsolete =~ m|(<copyright>)(default)|) { $rights = 1; }
 			}
 		    }
@@ -1729,7 +1729,7 @@
     }
     if ($ulsout eq '') { $ulsout='empty'; }
     &Reply($client, \$ulsout, $userinput); # This supports debug logging.
-    
+
     return 1;
 
 }
@@ -1738,7 +1738,7 @@
 # The ls2_handler routine should be considered obsolete and is retained
 # for communication with legacy servers.  Please see the ls3_handler.
 # Please also see the ls_handler, which was itself obsoleted by ls2.
-# ls2_handler differs from ls_handler in that it escapes its return 
+# ls2_handler differs from ls_handler in that it escapes its return
 # values before concatenating them together with ':'s.
 #
 #   ls2  - list the contents of a directory.  For each file in the
@@ -1795,14 +1795,14 @@
             if (opendir(LSDIR,$ulsdir)) {
                 while ($ulsfn=readdir(LSDIR)) {
                     undef($obs);
-		    undef($rights); 
+		    undef($rights);
                     my @ulsstats=stat($ulsdir.'/'.$ulsfn);
                     #We do some obsolete checking here
-                    if(-e $ulsdir.'/'.$ulsfn.".meta") { 
+                    if(-e $ulsdir.'/'.$ulsfn.".meta") {
                         open(FILE, $ulsdir.'/'.$ulsfn.".meta");
                         my @obsolete=<FILE>;
                         foreach my $obsolete (@obsolete) {
-                            if($obsolete =~ m/(<obsolete>)(on|1)/) { $obs = 1; } 
+                            if($obsolete =~ m/(<obsolete>)(on|1)/) { $obs = 1; }
                             if($obsolete =~ m|(<copyright>)(default)|) {
                                 $rights = 1;
                             }
@@ -1867,7 +1867,7 @@
 #                   - $alternate_root - path to prepend
 #                   - $uname - username to use for &propath or user dir
 #                   - $udom - domain to use for &propath or user dir
-#            All of these except $getpropath and &getuserdir are escaped.    
+#            All of these except $getpropath and &getuserdir are escaped.
 #                  no_such_dir.
 #    $client     - Socket open on the client.
 # Returns:
@@ -2026,7 +2026,7 @@
                                  lonBalancer     => 1,
                                  lonVersion      => 1,
                                  lonAdmEMail     => 1,
-                                 lonSupportEMail => 1,  
+                                 lonSupportEMail => 1,
                                  lonSysEMail     => 1,
                                  lonHostID       => 1,
                                  lonRole         => 1,
@@ -2155,7 +2155,7 @@
 &register_handler("servercerts", \&server_certs_handler, 0, 1, 0);
 
 #   Process a reinit request.  Reinit requests that either
-#   lonc or lond be reinitialized so that an updated 
+#   lonc or lond be reinitialized so that an updated
 #   host.tab or domain.tab can be processed.
 #
 # Parameters:
@@ -2170,9 +2170,9 @@
 #
 sub reinit_process_handler {
     my ($cmd, $tail, $client) = @_;
-   
+
     my $userinput = "$cmd:$tail";
-   
+
     my $cert = &GetCertificate($userinput);
     if(&ValidManager($cert)) {
 	chomp($userinput);
@@ -2201,13 +2201,13 @@
 #
 sub edit_table_handler {
     my ($command, $tail, $client) = @_;
-   
+
     my $userinput = "$command:$tail";
 
     my $cert = &GetCertificate($userinput);
     if(&ValidManager($cert)) {
 	my($filetype, $script) = split(/:/, $tail);
-	if (($filetype eq "hosts") || 
+	if (($filetype eq "hosts") ||
 	    ($filetype eq "domain")) {
 	    if($script ne "") {
 		&Reply($client,              # BUGBUG - EditFile
@@ -2232,7 +2232,7 @@
 #   possibilities:
 #   - unix     - The user can be authenticated against the unix
 #                password file.
-#   - internal - The user can be authenticated against a purely 
+#   - internal - The user can be authenticated against a purely
 #                internal per user password file.
 #   - kerberos - The user can be authenticated against either a kerb4 or kerb5
 #                ticket granting authority.
@@ -2253,11 +2253,11 @@
 sub authenticate_handler {
     my ($cmd, $tail, $client) = @_;
 
-    
-    #  Regenerate the full input line 
-    
+
+    #  Regenerate the full input line
+
     my $userinput  = $cmd.":".$tail;
-    
+
     #  udom    - User's domain.
     #  uname   - Username.
     #  upass   - User's password.
@@ -2265,7 +2265,7 @@
     #                 with default auth type(s) if no user account.
     #  clientcancheckhost - Passed by clients with functionality in lonauth.pm
     #                       to check if session can be hosted.
-    
+
     my ($udom, $uname, $upass, $checkdefauth, $clientcancheckhost)=split(/:/,$tail);
     &Debug(" Authenticate domain = $udom, user = $uname, password = $upass,  checkdefauth = $checkdefauth");
     chomp($upass);
@@ -2297,7 +2297,7 @@
                                                              $remote,$hosted);
             }
         }
-        if ($canhost) {               
+        if ($canhost) {
             &Reply( $client, "authorized\n", $userinput);
         } else {
             &Reply( $client, "not_allowed_to_host\n", $userinput);
@@ -2344,10 +2344,10 @@
     #  uname - Username.
     #  upass - Current password.
     #  npass - New password.
-    #  context - Context in which this was called 
+    #  context - Context in which this was called
     #            (preferences or reset_by_email).
-    #  lonhost - HostID of server where request originated 
-   
+    #  lonhost - HostID of server where request originated
+
     my ($udom,$uname,$upass,$npass,$context,$lonhost)=split(/:/,$tail);
 
     $upass=&unescape($upass);
@@ -2356,7 +2356,7 @@
 
     # First require that the user can be authenticated with their
     # old password unless context was 'reset_by_email':
-    
+
     my ($validated,$failure);
     if ($context eq 'reset_by_email') {
         if ($lonhost eq '') {
@@ -2455,7 +2455,7 @@
                 &update_passwd_history($uname,$udom,$howpwd,$context);
 		&Reply($client, "ok\n", $userinput);
 	    } else {
-		&logthis("Unable to open $uname passwd "               
+		&logthis("Unable to open $uname passwd "
 			 ."to change password");
 		&Failure( $client, "non_authorized\n",$userinput);
 	    }
@@ -2473,7 +2473,7 @@
 	    # locally written auth handler).
 	    #
 	    &Failure( $client, "auth_mode_error\n", $userinput);
-	}  
+	}
     } else {
 	if ($failure eq '') {
 	    $failure = 'non_authorized';
@@ -2571,7 +2571,7 @@
     }  else {
 	&Failure($client, "not_right_domain\n",
 		$userinput);	# Even if we are multihomed.
-    
+
     }
     return 1;
 
@@ -2601,12 +2601,12 @@
 #    input into the authentication process that are described above.
 # NOTE:
 #   This is also used to change the authentication credential values (e.g. passwd).
-#   
+#
 #
 sub change_authentication_handler {
 
     my ($cmd, $tail, $client) = @_;
-   
+
     my $userinput  = "$cmd:$tail";              # Reconstruct user input.
 
     my ($udom,$uname,$umode,$npass)=split(/:/,$tail);
@@ -2622,7 +2622,7 @@
 	my $passfilename = &password_path($udom, $uname);
 	if ($passfilename) {	# Not allowed to create a new user!!
 	    # If just changing the unix passwd. need to arrange to run
-	    # passwd since otherwise make_passwd_file will fail as 
+	    # passwd since otherwise make_passwd_file will fail as
 	    # creation of unix authenticated users is no longer supported
             # except from the command line, when running make_domain_coordinator.pl
 
@@ -2630,7 +2630,7 @@
 		my $result = &change_unix_password($uname, $npass);
 		&logthis("Result of password change for $uname: ".$result);
 		if ($result eq "ok") {
-                    &update_passwd_history($uname,$udom,$umode,'changeuserauth'); 
+                    &update_passwd_history($uname,$udom,$umode,'changeuserauth');
 		    &Reply($client, \$result);
 		} else {
 		    &Failure($client, \$result);
@@ -2648,9 +2648,9 @@
 
 		&Reply($client, \$result, $userinput);
 	    }
-	       
 
-	} else {	       
+
+	} else {
 	    &Failure($client, "non_authorized\n", $userinput); # Fail the user now.
 	}
     }
@@ -2717,9 +2717,9 @@
 #
 sub is_home_handler {
     my ($cmd, $tail, $client) = @_;
-   
+
     my $userinput  = "$cmd:$tail";
-   
+
     my ($udom,$uname)=split(/:/,$tail);
     chomp($uname);
     my $passfile = &password_filename($udom, $uname);
@@ -2736,7 +2736,7 @@
 #   Process an update request for a resource.
 #   A resource has been modified that we hold a subscription to.
 #   If the resource is not local, then we must update, or at least invalidate our
-#   cached copy of the resource. 
+#   cached copy of the resource.
 # Parameters:
 #    $cmd      - The command that got us here.
 #    $tail     - Tail of the command (remaining parameters).
@@ -2751,9 +2751,9 @@
 sub update_resource_handler {
 
     my ($cmd, $tail, $client) = @_;
-   
+
     my $userinput = "$cmd:$tail";
-   
+
     my $fname= $tail;		# This allows interactive testing
 
 
@@ -2933,7 +2933,7 @@
     my ($udom,$uname,$ufile) = ($fname =~ m|^([^/]+)/([^/]+)/(.+)$|);
     my $udir=&propath($udom,$uname).'/userfiles';
     unless (-e $udir) {
-	mkdir($udir,0770); 
+	mkdir($udir,0770);
     }
     Debug("fetch user file for $fname");
     if (-e $udir) {
@@ -2944,7 +2944,7 @@
 	# wiped out to deal with some earlier folly of mine.
 
 	if (!&mkpath($udir.'/'.$ufile)) {
-	    &Failure($client, "unable_to_create\n", $userinput);	    
+	    &Failure($client, "unable_to_create\n", $userinput);
 	}
 
 	my $destname=$udir.'/'.$ufile;
@@ -2994,7 +2994,7 @@
                 }
 		&Reply($client, "ok\n", $userinput);
 	    }
-	}   
+	}
     } else {
 	&Failure($client, "not_home\n", $userinput);
     }
@@ -3018,7 +3018,7 @@
 
     my ($udom,$uname,$ufile) = ($fname =~ m|^([^/]+)/([^/]+)/(.+)$|);
     if ($ufile =~m|/\.\./|) {
-	# any files paths with /../ in them refuse 
+	# any files paths with /../ in them refuse
 	# to deal with
 	&Failure($client, "refused\n", "$cmd:$tail");
     } else {
@@ -3028,13 +3028,13 @@
 	    if (-e $file) {
 		#
 		#   If the file is a regular file unlink is fine...
-		#   However it's possible the client wants a dir 
+		#   However it's possible the client wants a dir
 		#   removed, in which case rmdir is more appropriate.
 		#   Note: rmdir will only remove an empty directory.
 		#
 	        if (-f $file){
 		    unlink($file);
-                    # for html files remove the associated .bak file 
+                    # for html files remove the associated .bak file
                     # which may have been created by the editor.
                     if ($ufile =~ m{^((docs|supplemental)/(?:\d+|default)/\d+(?:|/.+)/)[^/]+\.x?html?$}i) {
                         my $path = $1;
@@ -3079,7 +3079,7 @@
     $dir=&unescape($dir);
     my ($udom,$uname,$ufile) = ($dir =~ m|^([^/]+)/([^/]+)/(.+)$|);
     if ($ufile =~m|/\.\./|) {
-	# any files paths with /../ in them refuse 
+	# any files paths with /../ in them refuse
 	# to deal with
 	&Failure($client, "refused\n", "$cmd:$tail");
     } else {
@@ -3154,7 +3154,7 @@
     my ($cmd, $tail, $client) = @_;
 
     my ($udom, $uname) = map { &unescape($_) } (split(/:/, $tail));
-    
+
     opendir(DIR,$perlvar{'lonIDsDir'});
     my $filename;
     while ($filename=readdir(DIR)) {
@@ -3219,7 +3219,7 @@
 &register_handler("delusersession", \&del_usersession_handler, 0,1,0);
 
 #
-#  Authenticate access to a user file by checking that the token the user's 
+#  Authenticate access to a user file by checking that the token the user's
 #  passed also exists in their session file
 #
 # Parameters:
@@ -3232,7 +3232,7 @@
     my ($cmd, $tail, $client) = @_;
 
     my ($fname, $session) = split(/:/, $tail);
-    
+
     chomp($session);
     my $reply="non_auth";
     my $file = $perlvar{'lonIDsDir'}.'/'.$session.'.id';
@@ -3275,7 +3275,7 @@
     my ($cmd, $tail, $client) = @_;
 
     my $userinput= "$cmd:$tail";
-    
+
     my ($fname) = split(/:/,$tail); # Split in case there's extrs.
 
     &Debug("Unsubscribing $fname");
@@ -3327,7 +3327,7 @@
     my ($cmd, $tail, $client) = @_;
 
     my $userinput= "$cmd:$tail";
-   
+
     my $fname   = $tail;
     &Reply( $client, &currentversion($fname)."\n", $userinput);
     return 1;
@@ -3356,13 +3356,13 @@
     my $proname=&propath($udom,$uname);
     my $now=time;
     my $hfh;
-    if ($hfh=IO::File->new(">>$proname/activity.log")) { 
+    if ($hfh=IO::File->new(">>$proname/activity.log")) {
 	print $hfh "$now:$clientname:$what\n";
         $hfh->close;
-	&Reply( $client, "ok\n", $userinput); 
+	&Reply( $client, "ok\n", $userinput);
     } else {
 	&Failure($client, "error: ".($!+0)." IO::File->new Failed "
-		 ."while attempting log\n", 
+		 ."while attempting log\n",
 		 $userinput);
     }
 
@@ -3388,7 +3388,7 @@
     my ($cmd, $tail, $client)  = @_;
 
     my $userinput = "$cmd:$tail";
-    
+
     my ($udom,$uname,$namespace,$what) =split(/:/,$tail,4);
     if ($namespace ne 'roles') {
 	chomp($what);
@@ -3404,7 +3404,7 @@
 		&Reply( $client, "ok\n", $userinput);
 	    } else {
 		&Failure($client, "error: ".($!+0)." untie(GDBM) failed ".
-			"while attempting put\n", 
+			"while attempting put\n",
 			$userinput);
 	    }
 	} else {
@@ -3414,7 +3414,7 @@
     } else {
         &Failure( $client, "refused\n", $userinput);
     }
-    
+
     return 1;
 }
 &register_handler("put", \&put_user_profile_entry, 0, 1, 0);
@@ -3471,14 +3471,14 @@
 	&Reply( $client, "ok\n", $userinput);
     } else {
 	&Failure($client, "error: ".($!+0)." untie(GDBM) failed ".
-		 "while attempting put\n", 
+		 "while attempting put\n",
 		 $userinput);
     }
     return 1;
 }
 &register_handler("newput", \&newput_user_profile_entry, 0, 1, 0);
 
-# 
+#
 #   Increment a profile entry in the user history file.
 #   The history contains keyword value pairs.  In this case,
 #   The value itself is a pair of numbers.  The first, the current value
@@ -3495,9 +3495,9 @@
 #
 sub increment_user_value_handler {
     my ($cmd, $tail, $client) = @_;
-    
+
     my $userinput   = "$cmd:$tail";
-    
+
     my ($udom,$uname,$namespace,$what) =split(/:/,$tail);
     if ($namespace ne 'roles') {
         chomp($what);
@@ -3533,7 +3533,7 @@
     } else {
 	&Failure($client, "refused\n", $userinput);
     }
-    
+
     return 1;
 }
 &register_handler("inc", \&increment_user_value_handler, 0, 1, 0);
@@ -3564,7 +3564,7 @@
     my $userinput  = "$cmd:$tail";
 
     my ( $exedom, $exeuser, $udom, $uname,  $what) = split(/:/,$tail);
-    
+
 
     my $namespace='roles';
     chomp($what);
@@ -3572,7 +3572,7 @@
 				 &GDBM_WRCREAT(), "P",
 				 "$exedom:$exeuser:$what");
     #
-    #  Log the attempt to set a role.  The {}'s here ensure that the file 
+    #  Log the attempt to set a role.  The {}'s here ensure that the file
     #  handle is open for the minimal amount of time.  Since the flush
     #  is done on close this improves the chances the log will be an un-
     #  corrupted ordered thing.
@@ -3622,7 +3622,7 @@
     my ($cmd, $tail, $client)  = @_;
 
     my $userinput    = "$cmd:$tail";
-   
+
     my ($exedom,$exeuser,$udom,$uname,$what)=split(/:/,$tail);
     &Debug("cmd = ".$cmd." exedom= ".$exedom."user = ".$exeuser." udom=".$udom.
 	   "what = ".$what);
@@ -3631,7 +3631,7 @@
     my $hashref = &tie_user_hash($udom, $uname, $namespace,
 				 &GDBM_WRCREAT(), "D",
 				 "$exedom:$exeuser:$what");
-    
+
     if ($hashref) {
 	my @rolekeys=split(/\&/,$what);
 	
@@ -3648,12 +3648,12 @@
         &Failure( $client, "error: ".($!+0)." tie(GDBM) Failed ".
 		 "while attempting rolesdel\n", $userinput);
     }
-    
+
     return 1;
 }
 &register_handler("rolesdel", \&roles_delete_handler, 1,1, 0); # Encoded client only
 
-# Unencrypted get from a user's profile database.  See 
+# Unencrypted get from a user's profile database.  See
 # GetProfileEntryEncrypted for a version that does end-to-end encryption.
 # This function retrieves a keyed item from a specific named database in the
 # user's directory.
@@ -3663,8 +3663,8 @@
 #   $tail            - Tail of the command.  This is a colon separated list
 #                      consisting of the domain and username that uniquely
 #                      identifies the profile,
-#                      The 'namespace' which selects the gdbm file to 
-#                      do the lookup in, 
+#                      The 'namespace' which selects the gdbm file to
+#                      do the lookup in,
 #                      & separated list of keys to lookup.  Note that
 #                      the values are returned as an & separated list too.
 #   $client          - File descriptor open on the client.
@@ -3676,7 +3676,7 @@
     my ($cmd, $tail, $client) = @_;
 
     my $userinput= "$cmd:$tail";
-   
+
     my ($udom,$uname,$namespace,$what) = split(/:/,$tail);
     chomp($what);
 
@@ -3718,7 +3718,7 @@
     my ($cmd, $tail, $client) = @_;
 
     my $userinput = "$cmd:$tail";
-   
+
     my ($udom,$uname,$namespace,$what) = split(/:/,$tail);
     chomp($what);
     my $qresult = read_profile($udom, $uname, $namespace, $what);
@@ -3730,7 +3730,7 @@
 	    $qresult.="         ";
 	    my $encqresult='';
 	    for(my $encidx=0;$encidx<=$cmdlength;$encidx+=8) {
-		$encqresult.= unpack("H16", 
+		$encqresult.= unpack("H16",
 				     $cipher->encrypt(substr($qresult,
 							     $encidx,
 							     8)));
@@ -3743,14 +3743,14 @@
 	&Failure($client, "$qresult while attempting eget\n", $userinput);
 
     }
-    
+
     return 1;
 }
 &register_handler("eget", \&get_profile_entry_encrypted, 0, 1, 0);
 
 #
 #   Deletes a key in a user profile database.
-#   
+#
 #   Parameters:
 #       $cmd                  - Command keyword (del).
 #       $tail                 - Command tail.  IN this case a colon
@@ -3798,7 +3798,7 @@
 #
 #  List the set of keys that are defined in a profile database file.
 #  A successful reply from this will contain an & separated list of
-#  the keys. 
+#  the keys.
 # Parameters:
 #     $cmd              - Command request (keys).
 #     $tail             - Remainder of the request, a colon separated
@@ -3834,7 +3834,7 @@
 	&Failure( $client, "error: ".($!+0)." tie(GDBM) Failed ".
 		 "while attempting keys\n", $userinput);
     }
-   
+
     return 1;
 }
 &register_handler("keys", \&get_profile_keys, 0, 1, 0);
@@ -3847,7 +3847,7 @@
 #   our client is trusted and I don't believe that's assured at present.
 #   Sure want badly to go to ssl or tls.  Of course if my peer isn't really
 #   a LonCAPA node they could have negotiated an encryption key too so >sigh<.
-# 
+#
 #  Parameters:
 #     $cmd           - The command request keyword (currentdump).
 #     $tail          - Remainder of the request, consisting of a colon
@@ -3869,11 +3869,11 @@
         Reply($client, \$res, "$cmd:$tail");
     }
 
-    return 1;  
+    return 1;
 
-    #TODO remove 
+    #TODO remove
     my $userinput = "$cmd:$tail";
-   
+
     my ($udom,$uname,$namespace) = split(/:/,$tail);
     my $hashref = &tie_user_hash($udom, $uname, $namespace,
 				 &GDBM_READER());
@@ -3889,7 +3889,7 @@
 	while (my ($key,$value) = each(%$hashref)) {
 	    my ($v,$symb,$param) = split(/:/,$key);
 	    next if ($v eq 'version' || $symb eq 'keys');
-	    next if (exists($data{$symb}) && 
+	    next if (exists($data{$symb}) &&
 		     exists($data{$symb}->{$param}) &&
 		     $data{$symb}->{'v.'.$param} > $v);
 	    $data{$symb}->{$param}=$value;
@@ -3940,7 +3940,7 @@
 #                                             selective dumps.
 #                               range       - optional range of entries
 #                                             e.g., 10-20 would return the
-#                                             10th to 19th items, etc.  
+#                                             10th to 19th items, etc.
 #   $client                   - Channel open on the client.
 # Returns:
 #    1    - Continue processing.
@@ -3951,7 +3951,7 @@
     my ($cmd, $tail, $client) = @_;
 
     my $res = LONCAPA::Lond::dump_with_regexp($tail, $clientversion);
-    
+
     if ($res =~ /^error:/) {
         Failure($client, \$res, "$cmd:$tail");
     } else {
@@ -4032,7 +4032,7 @@
 #
 sub store_handler {
     my ($cmd, $tail, $client) = @_;
- 
+
     my $userinput = "$cmd:$tail";
     chomp($tail);
     my ($udom,$uname,$namespace,$rid,$what,$laststore) =split(/:/,$tail);
@@ -4065,7 +4065,7 @@
             }
 	    $hashref->{"version:$rid"}++;
 	    my $version=$hashref->{"version:$rid"};
-	    my $allkeys=''; 
+	    my $allkeys='';
 	    foreach my $pair (@pairs) {
 		my ($key,$value)=split(/=/,$pair);
 		$allkeys.=$key.':';
@@ -4117,7 +4117,7 @@
 #    Writes to the client
 sub putstore_handler {
     my ($cmd, $tail, $client) = @_;
- 
+
     my $userinput = "$cmd:$tail";
 
     my ($udom,$uname,$namespace,$rid,$v,$what) =split(/:/,$tail);
@@ -4198,7 +4198,7 @@
 #    this continues for all pairs of keys in all versions.
 #
 #
-#    
+#
 #
 sub restore_handler {
     my ($cmd, $tail, $client) = @_;
@@ -4222,7 +4222,7 @@
 	    $qresult.="$scope:keys=$vkeys&";
 	    foreach $key (@keys) {
 		$qresult.="$scope:$key=".$hashref->{"$scope:$rid:$key"}."&";
-	    }                                  
+	    }
 	}
 	if (&untie_user_hash($hashref)) {
 	    $qresult=~s/\&$//;
@@ -4235,7 +4235,7 @@
 	&Failure($client, "error: ".($!+0)." tie(GDBM) Failed ".
 		"while attempting restore\n", $userinput);
     }
-  
+
     return 1;
 
 
@@ -4252,8 +4252,8 @@
 #                          cdom    - Domain on which the chat board lives
 #                          cnum    - Course containing the chat board.
 #                          newpost - Body of the posting.
-#                          group   - Optional group, if chat board is only 
-#                                    accessible in a group within the course 
+#                          group   - Optional group, if chat board is only
+#                                    accessible in a group within the course
 #   $client              - Socket open on the client.
 # Returns:
 #   1    - Indicating caller should keep on processing.
@@ -4265,7 +4265,7 @@
 sub send_chat_handler {
     my ($cmd, $tail, $client) = @_;
 
-    
+
     my $userinput = "$cmd:$tail";
 
     my ($cdom,$cnum,$newpost,$group)=split(/\:/,$tail);
@@ -4288,7 +4288,7 @@
 #                       domain/user    - Authentication domain and username
 #                                        of the requesting person.
 #                       group          - Optional course group containing
-#                                        the board.      
+#                                        the board.
 #   $client           - Socket open on the client program.
 # Returns:
 #    1     - continue processing
@@ -4374,7 +4374,7 @@
     &Reply($client, "". &sql_reply("$clientname\&$query".
 				"\&$arg1"."\&$arg2"."\&$arg3")."\n",
 	  $userinput);
-    
+
     return 1;
 }
 &register_handler("querysend", \&send_query_handler, 0, 1, 0);
@@ -4391,12 +4391,12 @@
 #   lonsql on completion of the query interacts with the lond of our
 #   client to do a query reply storing two files:
 #    - id     - The results of the query.
-#    - id.end - Indicating the transaction completed. 
+#    - id.end - Indicating the transaction completed.
 #    NOTE: id is a unique id assigned to the query and querysend time.
 # Parameters:
 #    $cmd        - Command keyword that initiated this request.
 #    $tail       - Remainder of the tail.  In this case that's a colon
-#                  separated list containing the query Id and the 
+#                  separated list containing the query Id and the
 #                  results of the query.
 #    $client     - Socket open on the client.
 # Return:
@@ -4410,7 +4410,7 @@
 
     my $userinput = "$cmd:$tail";
 
-    my ($id,$reply)=split(/:/,$tail); 
+    my ($id,$reply)=split(/:/,$tail);
     my $store;
     my $execdir=$perlvar{'lonDaemons'};
     if ($store=IO::File->new(">$execdir/tmp/$id")) {
@@ -4428,7 +4428,7 @@
 		." IO::File->new Failed ".
 		"while attempting queryreply\n", $userinput);
     }
- 
+
 
     return 1;
 }
@@ -4436,7 +4436,7 @@
 
 #
 #  Process the courseidput request.  Not quite sure what this means
-#  at the system level sense.  It appears a gdbm file in the 
+#  at the system level sense.  It appears a gdbm file in the
 #  /home/httpd/lonUsers/$domain/nohist_courseids is tied and
 #  a set of entries made in that database.
 #
@@ -4445,14 +4445,14 @@
 #   $tail     - Tail of the command.  In this case consists of a colon
 #               separated list contaning the domain to apply this to and
 #               an ampersand separated list of keyword=value pairs.
-#               Each value is a colon separated list that includes:  
+#               Each value is a colon separated list that includes:
 #               description, institutional code and course owner.
 #               For backward compatibility with versions included
 #               in LON-CAPA 1.1.X (and earlier) and 1.2.X, institutional
-#               code and/or course owner are preserved from the existing 
-#               record when writing a new record in response to 1.1 or 
-#               1.2 implementations of lonnet::flushcourselogs().   
-#                      
+#               code and/or course owner are preserved from the existing
+#               record when writing a new record in response to 1.1 or
+#               1.2 implementations of lonnet::flushcourselogs().
+#
 #   $client   - Socket open on the client.
 # Returns:
 #   1    - indicating that processing should continue
@@ -4481,11 +4481,11 @@
                 if (ref($value) eq 'HASH') {
                     my @items = ('description','inst_code','owner','type');
                     my @new_items = split(/:/,$courseinfo,-1);
-                    my %storehash; 
+                    my %storehash;
                     for (my $i=0; $i<@new_items; $i++) {
                         $storehash{$items[$i]} = &unescape($new_items[$i]);
                     }
-                    $hashref->{$key} = 
+                    $hashref->{$key} =
                         &Apache::lonnet::freeze_escape(\%storehash);
                     my $unesc_key = &unescape($key);
                     $hashref->{&escape('lasttime:'.$unesc_key)} = $now;
@@ -4502,7 +4502,7 @@
             my @new_items = split(/:/,$courseinfo,-1);
             my $numnew = scalar(@new_items);
             if ($numcurrent > 0) {
-                if ($numnew <= $numcurrent) { # flushcourselogs() from pre 2.2 
+                if ($numnew <= $numcurrent) { # flushcourselogs() from pre 2.2
                     for (my $j=$numcurrent-$numnew; $j>=0; $j--) {
                         $courseinfo .= ':'.$current_items[$numcurrent-$j-1];
                     }
@@ -4541,7 +4541,7 @@
             my $unesc_key = &unescape($key);
             if ($mode ne 'timeonly') {
                 if (!defined($hashref->{&escape('lasttime:'.$unesc_key)})) {
-                    my $curritems = &Apache::lonnet::thaw_unescape($key); 
+                    my $curritems = &Apache::lonnet::thaw_unescape($key);
                     if (ref($curritems) ne 'HASH') {
                         my @current_items = split(/:/,$hashref->{$key},-1);
                         my $lasttime = pop(@current_items);
@@ -4549,7 +4549,7 @@
                     } else {
                         $hashref->{&escape('lasttime:'.$unesc_key)} = '';
                     }
-                } 
+                }
                 $hashref->{$key} = $value;
             }
             if ($mode ne 'notime') {
@@ -4580,7 +4580,7 @@
 #     $cmd     - Command keyword that resulted in us being dispatched.
 #     $tail    - The remainder of the command that, in this case, consists
 #                of a colon separated list of:
-#                 domain   - The domain in which the course database is 
+#                 domain   - The domain in which the course database is
 #                            defined.
 #                 since    - Optional parameter describing the minimum
 #                            time of definition(?) of the resources that
@@ -4588,47 +4588,47 @@
 #                 description - regular expression that is used to filter
 #                            the dump.  Only keywords matching this regexp
 #                            will be used.
-#                 institutional code - optional supplied code to filter 
-#                            the dump. Only courses with an institutional code 
+#                 institutional code - optional supplied code to filter
+#                            the dump. Only courses with an institutional code
 #                            that match the supplied code will be returned.
 #                 owner    - optional supplied username and domain of owner to
 #                            filter the dump.  Only courses for which the course
 #                            owner matches the supplied username and/or domain
-#                            will be returned. Pre-2.2.0 legacy entries from 
+#                            will be returned. Pre-2.2.0 legacy entries from
 #                            nohist_courseiddump will only contain usernames.
-#                 type     - optional parameter for selection 
+#                 type     - optional parameter for selection
 #                 regexp_ok - if 1 or -1 allow the supplied institutional code
 #                            filter to behave as a regular expression:
-#	                      1 will not exclude the course if the instcode matches the RE 
+#	                      1 will not exclude the course if the instcode matches the RE
 #                            -1 will exclude the course if the instcode matches the RE
 #                 rtn_as_hash - whether to return the information available for
-#                            each matched item as a frozen hash of all 
-#                            key, value pairs in the item's hash, or as a 
+#                            each matched item as a frozen hash of all
+#                            key, value pairs in the item's hash, or as a
 #                            colon-separated list of (in order) description,
 #                            institutional code, and course owner.
-#                 selfenrollonly - filter by courses allowing self-enrollment  
+#                 selfenrollonly - filter by courses allowing self-enrollment
 #                                  now or in the future (selfenrollonly = 1).
-#                 catfilter - filter by course category, assigned to a course 
+#                 catfilter - filter by course category, assigned to a course
 #                             using manually defined categories (i.e., not
-#                             self-cataloging based on on institutional code).   
-#                 showhidden - include course in results even if course  
+#                             self-cataloging based on on institutional code).
+#                 showhidden - include course in results even if course
 #                              was set to be excluded from course catalog (DC only).
 #                 caller -  if set to 'coursecatalog', courses set to be hidden
 #                           from course catalog will be excluded from results (unless
 #                           overridden by "showhidden".
 #                 cloner - escaped username:domain of course cloner (if picking course to
 #                          clone).
-#                 cc_clone_list - escaped comma separated list of courses for which 
+#                 cc_clone_list - escaped comma separated list of courses for which
 #                                 course cloner has active CC role (and so can clone
 #                                 automatically).
 #                 cloneonly - filter by courses for which cloner has rights to clone.
 #                 createdbefore - include courses for which creation date preceeded this date.
 #                 createdafter - include courses for which creation date followed this date.
-#                 creationcontext - include courses created in specified context 
+#                 creationcontext - include courses created in specified context
 #
 #                 domcloner - flag to indicate if user can create CCs in course's domain.
 #                             If so, ability to clone course is automatic.
-#                 hasuniquecode - filter by courses for which a six character unique code has 
+#                 hasuniquecode - filter by courses for which a six character unique code has
 #                                 been set.
 #
 #     $client  - The socket open on the client.
@@ -4646,7 +4646,7 @@
         Reply($client, \$res, "$cmd:$tail");
     }
 
-    return 1;  
+    return 1;
 
     #TODO remove
     my $userinput = "$cmd:$tail";
@@ -4701,16 +4701,16 @@
     }
     if (defined($cloner)) {
         $cloner = &unescape($cloner);
-        ($cloneruname,$clonerudom) = ($cloner =~ /^($LONCAPA::match_username):($LONCAPA::match_domain)$/); 
+        ($cloneruname,$clonerudom) = ($cloner =~ /^($LONCAPA::match_username):($LONCAPA::match_domain)$/);
     }
     if (defined($cc_clone_list)) {
         $cc_clone_list = &unescape($cc_clone_list);
         my @cc_cloners = split('&',$cc_clone_list);
         foreach my $cid (@cc_cloners) {
             my ($clonedom,$clonenum) = split(':',$cid);
-            next if ($clonedom ne $udom); 
+            next if ($clonedom ne $udom);
             $cc_clone{$clonedom.'_'.$clonenum} = 1;
-        } 
+        }
     }
     if ($createdbefore ne '') {
         $createdbefore = &unescape($createdbefore);
@@ -4731,7 +4731,7 @@
         $hasuniquecode = '.';
     }
     my $unpack = 1;
-    if ($description eq '.' && $instcodefilter eq '.' && $ownerfilter eq '.' && 
+    if ($description eq '.' && $instcodefilter eq '.' && $ownerfilter eq '.' &&
         $typefilter eq '.') {
         $unpack = 0;
     }
@@ -4828,17 +4828,17 @@
                     }
                 }
                 if ($creationcontext ne '.') {
-                    next if (($context ne '') && ($context ne $creationcontext));  
+                    next if (($context ne '') && ($context ne $creationcontext));
                 }
                 if ($createdbefore > 0) {
-                    next if (($created eq '') || ($created > $createdbefore));   
+                    next if (($created eq '') || ($created > $createdbefore));
                 }
                 if ($createdafter > 0) {
-                    next if (($created eq '') || ($created <= $createdafter)); 
+                    next if (($created eq '') || ($created <= $createdafter));
                 }
                 if ($catfilter ne '') {
                     next if ($items->{'categories'} eq '');
-                    my @categories = split('&',$items->{'categories'}); 
+                    my @categories = split('&',$items->{'categories'});
                     next if (@categories == 0);
                     my @subcats = split('&',$catfilter);
                     my $matchcat = 0;
@@ -4910,10 +4910,10 @@
                 }
                 if (($ownerunamefilter ne '') && ($ownerdomfilter ne '')) {
                     if ($unesc_val{'owner'} =~ /:/) {
-                        if (eval{$unesc_val{'owner'} !~ 
+                        if (eval{$unesc_val{'owner'} !~
                              /\Q$ownerunamefilter\E:\Q$ownerdomfilter\E$/i}) {
                             $match = 0;
-                        } 
+                        }
                     } else {
                         if (eval{$unesc_val{'owner'} !~ /\Q$ownerunamefilter\E/i}) {
                             $match = 0;
@@ -5009,7 +5009,7 @@
 sub course_lastaccess_handler {
     my ($cmd, $tail, $client) = @_;
     my $userinput = "$cmd:$tail";
-    my ($cdom,$cnum) = split(':',$tail); 
+    my ($cdom,$cnum) = split(':',$tail);
     my (%lastaccess,$qresult);
     my $hashref = &tie_domain_hash($cdom, "nohist_courseids", &GDBM_WRCREAT());
     if ($hashref) {
@@ -5034,7 +5034,7 @@
             }
         }
         foreach my $cid (sort(keys(%lastaccess))) {
-            $qresult.=&escape($cid).'='.$lastaccess{$cid}.'&'; 
+            $qresult.=&escape($cid).'='.$lastaccess{$cid}.'&';
         }
         if (&untie_domain_hash($hashref)) {
             if ($qresult) {
@@ -5078,7 +5078,7 @@
                 $sessions{$uname.':'.$udom} = $mtime;
             }
         }
-        closedir(DIR); 
+        closedir(DIR);
     }
     foreach my $user (keys(%sessions)) {
         $qresult.=&escape($user).'='.$sessions{$user}.'&';
@@ -5092,7 +5092,7 @@
 &register_handler("coursesessions",\&course_sessions_handler, 0, 1, 0);
 
 #
-# Puts an unencrypted entry in a namespace db file at the domain level 
+# Puts an unencrypted entry in a namespace db file at the domain level
 #
 # Parameters:
 #    $cmd      - The command that got us here.
@@ -5212,7 +5212,7 @@
 #    $tail     - Tail of the command (remaining parameters).
 #                In this case a colon separated list containing:
 #                (a) the domain for which we are deleting the entries,
-#                (b) &-separated list of keys to delete.  
+#                (b) &-separated list of keys to delete.
 #    $client   - File descriptor connected to client.
 # Returns
 #     1        - Continue processing.
@@ -5257,7 +5257,7 @@
 # Parameters:
 #   $cmd             - Command request keyword (getdom).
 #   $tail            - Tail of the command.  This is a colon separated list
-#                      consisting of the domain and the 'namespace' 
+#                      consisting of the domain and the 'namespace'
 #                      which selects the gdbm file to do the lookup in,
 #                      & separated list of keys to lookup.  Note that
 #                      the values are returned as an & separated list too.
@@ -5412,7 +5412,7 @@
 # then signed with the appropriate key and secret, before re-encrypting
 # the signed payload which is sent to the client for unencryption by
 # the caller: lonnet::sign_lti()) before dispatch either to a web browser
-# (launch) or to a remote web service (roster, logout, or grade).  
+# (launch) or to a remote web service (roster, logout, or grade).
 #
 # Parameters:
 #   $cmd             - Command request keyword (signlti).
@@ -5423,7 +5423,7 @@
 #                      context (launch, roster, logout, or grade),
 #                      escaped launch URL, numeric ID of external tool,
 #                      version number for encryption key (if tool's LTI secret was
-#                      encrypted before storing), a frozen hash of LTI launch 
+#                      encrypted before storing), a frozen hash of LTI launch
 #                      parameters, and a frozen hash of LTI information,
 #                      (e.g., method => 'HMAC-SHA1',
 #                             respfmt => 'to_authorization_header').
@@ -5483,11 +5483,11 @@
 &register_handler("signlti", \&sign_lti_handler, 1, 1, 0);
 
 #
-#  Puts an id to a domains id database. 
+#  Puts an id to a domains id database.
 #
 #  Parameters:
 #   $cmd     - The command that triggered us.
-#   $tail    - Remainder of the request other than the command. This is a 
+#   $tail    - Remainder of the request other than the command. This is a
 #              colon separated list containing:
 #              $domain  - The domain for which we are writing the id.
 #              $pairs  - The id info to write... this is and & separated list
@@ -5551,9 +5551,9 @@
 sub get_id_handler {
     my ($cmd, $tail, $client) = @_;
 
-    
+
     my $userinput = "$client:$tail";
-    
+
     my ($udom,$what)=split(/:/,$tail);
     chomp($what);
     my @queries=split(/\&/,$what);
@@ -5574,7 +5574,7 @@
 	&Failure($client, "error: ".($!+0)." tie(GDBM) Failed ".
 		 "while attempting idget\n",$userinput);
     }
-    
+
     return 1;
 }
 &register_handler("idget", \&get_id_handler, 0, 1, 0);
@@ -5591,7 +5591,7 @@
 # Returns:
 #     1   - Continue processing
 #     0   - Exit server.
-#     
+#
 #
 
 sub del_id_handler {
@@ -5623,13 +5623,13 @@
 &register_handler("iddel", \&del_id_handler, 0, 1, 0);
 
 #
-# Puts broadcast e-mail sent by Domain Coordinator in nohist_dcmail database 
+# Puts broadcast e-mail sent by Domain Coordinator in nohist_dcmail database
 #
 # Parameters
 #   $cmd       - Command keyword that caused us to be dispatched.
 #   $tail      - Tail of the command.  Consists of a colon separated:
 #               domain - the domain whose dcmail we are recording
-#               email    Consists of key=value pair 
+#               email    Consists of key=value pair
 #                        where key is unique msgid
 #                        and value is message (in XML)
 #   $client    - Socket open on the client.
@@ -5670,21 +5670,21 @@
 #   $cmd       - Command keyword that caused us to be dispatched.
 #   $tail      - Tail of the command.  Consists of a colon separated:
 #               domain - the domain whose dcmail table we dump
-#               startfilter - beginning of time window 
+#               startfilter - beginning of time window
 #               endfilter - end of time window
-#               sendersfilter - & separated list of username:domain 
+#               sendersfilter - & separated list of username:domain
 #                 for senders to search for.
 #   $client    - Socket open on the client.
 #
 # Returns:
 #    1 - indicating processing should continue.
 # Side effects
-#     reply (& separated list of msgid=messageinfo pairs) is 
+#     reply (& separated list of msgid=messageinfo pairs) is
 #     written to $client.
 #
 sub dump_dcmail_handler {
     my ($cmd, $tail, $client) = @_;
-                                                                                
+
     my $userinput = "$cmd:$tail";
     my ($udom,$startfilter,$endfilter,$sendersfilter) = split(/:/,$tail);
     chomp($sendersfilter);
@@ -5709,7 +5709,7 @@
     if ($hashref) {
         while (my ($key,$value) = each(%$hashref)) {
             my $match = 1;
-            my ($timestamp,$subj,$uname,$udom) = 
+            my ($timestamp,$subj,$uname,$udom) =
 		split(/:/,&unescape(&unescape($key)),5); # yes, twice really
             $subj = &unescape($subj);
             unless ($startfilter eq '.' || !defined($startfilter)) {
@@ -5753,7 +5753,7 @@
 # Parameters
 #   $cmd       - Command keyword that caused us to be dispatched.
 #   $tail      - Tail of the command.  Consists of a colon separated:
-#               domain - the domain whose roles we are recording  
+#               domain - the domain whose roles we are recording
 #               role -   Consists of key=value pair
 #                        where key is unique role
 #                        and value is start/end date information
@@ -5788,7 +5788,7 @@
         &Failure( $client, "error: ".($!+0)." tie(GDBM) Failed ".
                   "while attempting domroleput\n", $userinput);
     }
-                                                                                  
+
     return 1;
 }
 
@@ -5813,7 +5813,7 @@
 #
 sub dump_domainroles_handler {
     my ($cmd, $tail, $client) = @_;
-                                                                                           
+
     my $userinput = "$cmd:$tail";
     my ($udom,$startfilter,$endfilter,$rolesfilter) = split(/:/,$tail);
     chomp($rolesfilter);
@@ -5932,7 +5932,7 @@
 		  "while attempting tmpput\n", $userinput);
     }
     return 1;
-  
+
 }
 &register_handler("tmpput", \&tmp_put_handler, 0, 1, 0);
 
@@ -5952,8 +5952,8 @@
 sub tmp_get_handler {
     my ($cmd, $id, $client) = @_;
 
-    my $userinput = "$cmd:$id"; 
-    
+    my $userinput = "$cmd:$id";
+
 
     $id=~s/\W/\_/g;
     my $store;
@@ -5987,9 +5987,9 @@
 #   A reply is sent to the client.
 sub tmp_del_handler {
     my ($cmd, $id, $client) = @_;
-    
+
     my $userinput= "$cmd:$id";
-    
+
     chomp($id);
     $id=~s/\W/\_/g;
     my $execdir=$perlvar{'lonDaemons'};
@@ -5999,7 +5999,7 @@
 	&Failure( $client, "error: ".($!+0)."Unlink tmp Failed ".
 		  "while attempting tmpdel\n", $userinput);
     }
-    
+
     return 1;
 
 }
@@ -6136,7 +6136,7 @@
 #
 sub set_announce_handler {
     my ($cmd, $announcement, $client) = @_;
-  
+
     my $userinput    = "$cmd:$announcement";
 
     chomp($announcement);
@@ -6171,7 +6171,7 @@
     my ($cmd, $tail, $client) = @_;
 
     my $userinput  = $cmd.$tail;
-    
+
     &Reply($client, &version($userinput)."\n", $userinput);
 
 
@@ -6198,7 +6198,7 @@
 #
 sub set_virtual_host_handler {
     my ($cmd, $tail, $socket) = @_;
-  
+
     my $userinput  ="$cmd:$tail";
 
     &Reply($client, &sethost($userinput)."\n", $userinput);
@@ -6262,14 +6262,14 @@
 &register_handler("autorun", \&enrollment_enabled_handler, 0, 1, 0);
 
 #
-#   Validate an institutional code used for a LON-CAPA course.          
+#   Validate an institutional code used for a LON-CAPA course.
 #
 # Formal Parameters:
 #   $cmd          - The command request that got us dispatched.
 #   $tail         - The tail of the command.  In this case,
 #                   this is a colon separated set of words that will be split
 #                   into:
-#                        $dom      - The domain for which the check of 
+#                        $dom      - The domain for which the check of
 #                                    institutional course code will occur.
 #
 #                        $instcode - The institutional code for the course
@@ -6315,7 +6315,7 @@
 #      $instcode       - Institutional course code for the course
 #      $inst_xlist     - Institutional course Id for the crosslisting
 #      $coowner        - Username of co-owner
-#      (values for all but $dom have been escaped). 
+#      (values for all but $dom have been escaped).
 #
 #   $client       - Socket open on the client.
 # Returns:
@@ -6341,7 +6341,7 @@
 &register_handler("autovalidateinstcrosslist", \&validate_instcrosslist_handler, 0, 1, 0);
 
 #   Get the official sections for which auto-enrollment is possible.
-#   Since the admin people won't know about 'unofficial sections' 
+#   Since the admin people won't know about 'unofficial sections'
 #   we cannot auto-enroll on them.
 # Formal Parameters:
 #    $cmd     - The command request that got us dispatched here.
@@ -6369,7 +6369,7 @@
 }
 &register_handler("autogetsections", \&get_sections_handler, 0, 1, 0);
 
-#   Validate the owner of a new course section.  
+#   Validate the owner of a new course section.
 #
 # Formal Parameters:
 #   $cmd      - Command that got us dispatched.
@@ -6389,7 +6389,7 @@
     my ($cmd, $tail, $client)  = @_;
     my $userinput = "$cmd:$tail";
     my ($inst_course_id, $owner, $cdom, $coowners) = split(/:/, $tail);
-    
+
     $owner = &unescape($owner);
     $coowners = &unescape($coowners);
     my $outcome;
@@ -6434,15 +6434,15 @@
 &register_handler("autovalidatecourse", \&validate_course_section_handler, 0, 1, 0);
 
 #
-#   Validate course owner's access to enrollment data for specific class section. 
-#   
+#   Validate course owner's access to enrollment data for specific class section.
+#
 #
 # Formal Parameters:
 #    $cmd     - The command request that got us dispatched.
 #    $tail    - The tail of the command.   In this case this is a colon separated
 #               set of values that will be split into:
-#               $inst_class  - Institutional code for the specific class section   
-#               $ownerlist   - An escaped comma-separated list of username:domain 
+#               $inst_class  - Institutional code for the specific class section
+#               $ownerlist   - An escaped comma-separated list of username:domain
 #                              of the course owner, and co-owner(s).
 #               $cdom        - The domain of the course from the institution's
 #                              point of view.
@@ -6468,7 +6468,7 @@
 
 #
 #    Modify institutional sections (using customized &instsec_reformat()
-#    routine in localenroll.pm), to either clutter or declutter, for  
+#    routine in localenroll.pm), to either clutter or declutter, for
 #    purposes of ensuring an institutional course section (string) can
 #    be unambiguously separated into institutional course and section.
 #
@@ -6481,15 +6481,15 @@
 #                              clutter adds character(s) to eliminate ambiguity
 #                              declutter removes the added characters (e.g., for
 #                              display of the institutional course section string.
-#               $info        - A frozen hash in which keys are: 
+#               $info        - A frozen hash in which keys are:
 #                              LON-CAPA course number:Institutional course code
 #                              and values are a reference to an array of the
 #                              items to modify -- either institutional sections,
-#                              or institutional course sections (for crosslistings). 
+#                              or institutional course sections (for crosslistings).
 #    $client  - The socket open on the client.
 # Returns:
 #    1 - continue processing.
-#   
+#
 
 sub instsec_reformat_handler {
     my ($cmd, $tail, $client) = @_;
@@ -6596,7 +6596,7 @@
     my ($create_passwd,$authchk);
     eval {
         local($SIG{__DIE__})='DEFAULT';
-        ($authparam,$create_passwd,$create_passwd,$authchk) = 
+        ($authparam,$create_passwd,$create_passwd,$authchk) =
             &localenroll::create_password($authparam,$cdom);
     };
     &Reply($client, &escape($authparam.':'.$create_passwd.':'.$authchk)."\n",
@@ -6605,7 +6605,7 @@
 
     return 1;
 }
-&register_handler("autocreatepassword", \&create_auto_enroll_password_handler, 
+&register_handler("autocreatepassword", \&create_auto_enroll_password_handler,
 		  0, 1, 0);
 
 sub auto_export_grades_handler {
@@ -6657,7 +6657,7 @@
 #
 # Formal Parameters:
 #    $cmd      - The command that got us dispatched.
-#    $tail     - The tail of the command.  In our case this is a colon 
+#    $tail     - The tail of the command.  In our case this is a colon
 #                separated list that will be split into:
 #                $filename - The name of the file to retrieve.
 #                            The filename is given as a path relative to
@@ -6699,7 +6699,7 @@
     } else {
 	&Failure($client, "error\n", $userinput);
     }
-    
+
 
     return 1;
 }
@@ -6716,7 +6716,7 @@
         my %validations;
         my $response = &localenroll::crsreq_checks($dom,\@reqtypes,
                                                    \%validations);
-        if ($response eq 'ok') { 
+        if ($response eq 'ok') {
             foreach my $key (keys(%validations)) {
                 $result .= &escape($key).'='.&Apache::lonnet::freeze_escape($validations{$key}).'&';
             }
@@ -6834,7 +6834,7 @@
 	my ($key,$value) = split/=/,$_;
 	$instcodes{&unescape($key)} = &unescape($value);
     }
-    my $formatreply; 
+    my $formatreply;
     eval {
         local($SIG{__DIE__})='DEFAULT';
         $formatreply = &localenroll::instcode_format($cdom,
@@ -6859,7 +6859,7 @@
 	#
 	&Reply($client, "format_error\n", $userinput);
     }
-    
+
     return 1;
 }
 &register_handler("autoinstcodeformat",
@@ -7159,10 +7159,10 @@
 # Get domain specific conditions for import of student photographs to a course
 #
 # Retrieves information from photo_permission subroutine in localenroll.
-# Returns outcome (ok) if no processing errors, and whether course owner is 
+# Returns outcome (ok) if no processing errors, and whether course owner is
 # required to accept conditions of use (yes/no).
 #
-#    
+#
 sub photo_permission_handler {
     my ($cmd, $tail, $client)   = @_;
     my $userinput               = "$cmd:$tail";
@@ -7188,7 +7188,7 @@
 # Checks if student photo is available for a user in the domain, in the user's
 # directory (in /userfiles/internal/studentphoto.jpg).
 # Uses localstudentphoto:fetch() to ensure there is an up to date copy of
-# the student's photo.   
+# the student's photo.
 
 sub photo_check_handler {
     my ($cmd, $tail, $client)   = @_;
@@ -7210,10 +7210,10 @@
 &register_handler("autophotocheck",\&photo_check_handler,0,1,0);
 
 #
-# Retrieve information from localenroll about whether to provide a button     
-# for users who have enbled import of student photos to initiate an 
-# update of photo files for registered students. Also include 
-# comment to display alongside button.  
+# Retrieve information from localenroll about whether to provide a button
+# for users who have enbled import of student photos to initiate an
+# update of photo files for registered students. Also include
+# comment to display alongside button.
 
 sub photo_choice_handler {
     my ($cmd, $tail, $client) = @_;
@@ -7234,7 +7234,7 @@
 &register_handler("autophotochoice",\&photo_choice_handler,0,1,0);
 
 #
-# Gets a student's photo to exist (in the correct image type) in the user's 
+# Gets a student's photo to exist (in the correct image type) in the user's
 # directory.
 # Formal Parameters:
 #    $cmd     - The command request that got us dispatched.
@@ -7320,7 +7320,7 @@
     my @parts=split(/\//,$file,-1);
     my $now=$parts[0].'/'.$parts[1].'/'.$parts[2];
     for (my $i=3;$i<= ($#parts-1);$i++) {
-	$now.='/'.$parts[$i]; 
+	$now.='/'.$parts[$i];
 	if (!-e $now) {
 	    if  (!mkdir($now,0770)) { return 0; }
 	}
@@ -7336,7 +7336,7 @@
 #   Get a Request:
 #   Gets a Request message from the client.  The transaction
 #   is defined as a 'line' of text.  We remove the new line
-#   from the text line.  
+#   from the text line.
 #
 sub get_request {
     my $input = <$client>;
@@ -7351,8 +7351,8 @@
 #---------------------------------------------------------------
 #
 #  Process a request.  This sub should shrink as each action
-#  gets farmed out into a separat sub that is registered 
-#  with the dispatch hash.  
+#  gets farmed out into a separat sub that is registered
+#  with the dispatch hash.
 #
 # Parameters:
 #    user_input   - The request received from the client (lonc).
@@ -7390,8 +7390,8 @@
 	}
     }
     Debug("process_request: $userinput\n");
-    
-    #  
+
+    #
     #   The 'correct way' to add a command to lond is now to
     #   write a sub to execute it and Add it to the command dispatch
     #   hash via a call to register_handler..  The comments to that
@@ -7401,7 +7401,7 @@
     #   if/elseif monster below have been factored out into
     #   separate procesor subs, if the dispatch hash is missing
     #   the command keyword, we will fall through to the remainder
-    #   of the if/else chain below in order to keep this thing in 
+    #   of the if/else chain below in order to keep this thing in
     #   working order throughout the transmogrification.
 
     my ($command, $tail) = split(/:/, $userinput, 2);
@@ -7423,9 +7423,9 @@
 	my $client_types  = $$dispatch_info[2];
 	Debug("Matched dispatch hash: mustencode: $need_encode "
 	      ."ClientType $client_types");
-      
+
 	#  Validate the request:
-      
+
 	my $ok = 1;
 	my $requesterprivs = 0;
 	if(&isClient()) {
@@ -7447,7 +7447,7 @@
             if ($command eq 'querysend') {
                 my ($query,$rest)=split(/\:/,$tail,2);
                 $query=~s/\n*$//g;
-                my @possqueries = 
+                my @possqueries =
                     qw(userlog courselog fetchenrollment institutionalphotos usersearch instdirsearch getinstuser getmultinstusers clonecrsauthor);
                 if (grep(/^\Q$query\E$/, at possqueries)) {
                     $command .= '_'.$query;
@@ -7492,7 +7492,7 @@
                             $ok = 1;
                         } else {
                             $ok = 0;
-                        } 
+                        }
                     }
                 }
             }
@@ -7527,12 +7527,12 @@
 sub decipher {
     my ($input)  = @_;
     my $output = '';
-    
-    
+
+
     if($cipher) {
 	my($enc, $enclength, $encinput) = split(/:/, $input);
 	for(my $encidx = 0; $encidx < length($encinput); $encidx += 16) {
-	    $output .= 
+	    $output .=
 		$cipher->decrypt(pack("H16", substr($encinput, $encidx, 16)));
 	}
 	return substr($output, 0, $enclength);
@@ -7565,19 +7565,19 @@
 #    $manager_ok           - True if it's ok for a manager to request this.
 # Side effects:
 #      - On success, the Dispatcher hash has an entry added for the key $RequestName
-#      - On failure, the program will die as it's a bad internal bug to try to 
+#      - On failure, the program will die as it's a bad internal bug to try to
 #        register a duplicate command handler.
 #
 sub register_handler {
     my ($request_name,$procedure,$must_encode,	$client_ok,$manager_ok)   = @_;
 
     #  Don't allow duplication#
-   
+
     if (defined $Dispatcher{$request_name}) {
 	die "Attempting to define a duplicate request handler for $request_name\n";
     }
     #   Build the client type mask:
-    
+
     my $client_type_mask = 0;
     if($client_ok) {
 	$client_type_mask  |= $CLIENT_OK;
@@ -7585,13 +7585,13 @@
     if($manager_ok) {
 	$client_type_mask  |= $MANAGER_OK;
     }
-   
+
     #  Enter the hash:
-      
+
     my @entry = ($procedure, $must_encode, $client_type_mask);
-   
+
     $Dispatcher{$request_name} = \@entry;
-   
+
 }
 
 
@@ -7846,10 +7846,10 @@
 	    &logthis ('Child '.$_.' is dead');
             &logstatus($$.' is dead');
 	    delete($children{$_});
-        } 
+        }
     }
     sleep 5;
-    $SIG{ALRM} = sub { Debug("timeout"); 
+    $SIG{ALRM} = sub { Debug("timeout");
 		       die "timeout";  };
     $SIG{__DIE__} = 'DEFAULT';
     &status("Checking on the children (waiting for reports)");
@@ -7907,7 +7907,7 @@
 #     request - Original request from client.
 #
 #NOTE $reply must be terminated by exactly *one* \n. If $reply is a reference
-#this is done automatically ($$reply must not contain any \n in this case). 
+#this is done automatically ($$reply must not contain any \n in this case).
 #If $reply is a string the caller has to ensure this.
 sub Reply {
     my ($fd, $reply, $request) = @_;
@@ -7935,14 +7935,14 @@
 #               to debug if that's enabled.
 # Implicit outputs:
 #    $Failures- The number of failures is incremented.
-#    Reply (invoked here) sends a message to the 
+#    Reply (invoked here) sends a message to the
 #    client:
 #
 sub Failure {
     my $fd      = shift;
     my $reply   = shift;
     my $request = shift;
-   
+
     $Failures++;
     Reply($fd, $reply, $request);      # That's simple eh?
 }
@@ -8103,7 +8103,7 @@
     $client = shift;
     &status('Starting new child '.$client);
     &logthis('<font color="green"> Attempting to start child ('.$client.
-	     ")</font>");    
+	     ")</font>");
     # block signal for fork
     $sigset = POSIX::SigSet->new(SIGINT);
     sigprocmask(SIG_BLOCK, $sigset)
@@ -8115,7 +8115,7 @@
 	                               # connection liveness.
 
     #
-    #  Figure out who we're talking to so we can record the peer in 
+    #  Figure out who we're talking to so we can record the peer in
     #  the pid hash.
     #
     my $caller = getpeername($client);
@@ -8132,7 +8132,7 @@
 	&logthis("Unable to determine clientip");
 	$clientip='Unavailable';
     }
-    
+
     if ($pid) {
         # Parent records the child's birth and returns.
         sigprocmask(SIG_UNBLOCK, $sigset)
@@ -8144,12 +8144,12 @@
     } else {
         # Child can *not* return from this subroutine.
         $SIG{INT} = 'DEFAULT';      # make SIGINT kill us as it did before
-        $SIG{CHLD} = 'DEFAULT'; #make this default so that pwauth returns 
+        $SIG{CHLD} = 'DEFAULT'; #make this default so that pwauth returns
                                 #don't get intercepted
         $SIG{USR1}= \&logstatus;
         $SIG{ALRM}= \&timeout;
 	#
-	# Block sigpipe as it gets thrownon socket disconnect and we want to 
+	# Block sigpipe as it gets thrownon socket disconnect and we want to
 	# deal with that as a read faiure instead.
 	#
 	my $blockset = POSIX::SigSet->new(SIGPIPE);
@@ -8173,7 +8173,7 @@
             }
         } elsif ($dist =~ /^suse(\d+\.\d+)$/) {
             if (($1 eq '9.3') || ($1 >= 12.2)) {
-                $no_ets = 1; 
+                $no_ets = 1;
             }
         } elsif ($dist =~ /^sles(\d+)$/) {
             if ($1 > 11) {
@@ -8219,7 +8219,7 @@
 	    &logthis('<font color="yellow">INFO: Connection, '.
 		     $clientip.
 		  " ($clientname) connection type = $ConnectionType </font>" );
-	    &status("Connecting $clientip  ($clientname))"); 
+	    &status("Connecting $clientip  ($clientname))");
 	    my $remotereq=<$client>;
 	    chomp($remotereq);
 	    Debug("Got init: $remotereq");
@@ -8232,13 +8232,13 @@
 		(my $i, my $inittype, $clientversion) = split(/:/, $remotereq);
         # For LON-CAPA 2.9, the  client session will have sent its LON-CAPA
         # version when initiating the connection. For LON-CAPA 2.8 and older,
-        # the version is retrieved from the global %loncaparevs in lonnet.pm.            
+        # the version is retrieved from the global %loncaparevs in lonnet.pm.
         # $clientversion contains path to keyfile if $inittype eq 'local'
         # it's overridden below in this case
         $clientversion ||= $Apache::lonnet::loncaparevs{$clientname};
 
 		# If the connection type is ssl, but I didn't get my
-		# certificate files yet, then I'll drop  back to 
+		# certificate files yet, then I'll drop  back to
 		# insecure (if allowed).
 
                 if ($inittype eq "ssl") {
@@ -8269,8 +8269,8 @@
 		if($inittype eq "ssl") {
 		    my ($ca, $cert) = lonssl::CertificateFile;
 		    my $kfile       = lonssl::KeyFile;
-		    if((!$ca)   || 
-		       (!$cert) || 
+		    if((!$ca)   ||
+		       (!$cert) ||
 		       (!$kfile)) {
 			$inittype = ""; # This forces insecure attempt.
 			&logthis("<font color=\"blue\"> Certificates not "
@@ -8306,12 +8306,12 @@
 			&logthis('<font color="green">'
 				 ."Successfull ssl authentication with $clientname </font>");
 			$keymode = "ssl";
-	     
+
 		    } else {
 			$clientok = 0;
 			close $client;
 		    }
-	   
+
 		} else {
 		    my $ok = InsecureConnection($client);
 		    if($ok) {
@@ -8338,10 +8338,10 @@
 		     "<font color='blue'>WARNING: Unknown client $clientip</font>");
 	    &status('Hung up on '.$clientip);
 	}
- 
+
 	if ($clientok) {
 # ---------------- New known client connecting, could mean machine online again
-	    if (&Apache::lonnet::get_host_ip($currenthostid) ne $clientip 
+	    if (&Apache::lonnet::get_host_ip($currenthostid) ne $clientip
 		&& $clientip ne '127.0.0.1') {
 		&Apache::lonnet::reconlonc($clientname);
 	    }
@@ -8367,18 +8367,18 @@
 		     ."Rejected client $clientip, closing connection</font>");
 	}
     }
-    
+
 # =============================================================================
-    
+
     &logthis("<font color='red'>CRITICAL: "
-	     ."Disconnect from $clientip ($clientname)</font>");    
+	     ."Disconnect from $clientip ($clientname)</font>");
 
 
     # this exit is VERY important, otherwise the child will become
     # a producer of more and more children, forking yourself into
     # process death.
     exit;
-    
+
 }
 
 #
@@ -8393,7 +8393,7 @@
 #
 #  If called in array context will not set package variables, but will
 #  instead return an array of two values - (a) true if client is in the
-#  same domain as the server, and (b) true if client is in the same 
+#  same domain as the server, and (b) true if client is in the same
 #  internet domain.
 #
 #  If called in scalar context, sets package variables for current client:
@@ -8491,7 +8491,7 @@
 }
 #
 #   Checks to see if the input roleput request was to set
-# an author role.  If so, creates construction space 
+# an author role.  If so, creates construction space
 # Parameters:
 #    request   - The request sent to the rolesput subchunk.
 #                We're looking for  /domain/_au
@@ -8504,7 +8504,7 @@
     # See if the request is of the form /$domain/_au
     if($request =~ /^(\/\Q$domain\E\/_au)$/) { # It's an author rolesput...
         my $path=$perlvar{'lonDocRoot'}."/priv/$domain";
-        unless (-e $path) {        
+        unless (-e $path) {
            mkdir($path);
         }
         unless (-e $path.'/'.$user) {
@@ -8599,7 +8599,7 @@
     my ($domain, $user)  = @_;
 
     Debug("get_auth_type( $domain, $user ) \n");
-    my $proname    = &propath($domain, $user); 
+    my $proname    = &propath($domain, $user);
     my $passwdfile = "$proname/passwd";
     if( -e $passwdfile ) {
 	my $pf;
@@ -8609,7 +8609,7 @@
 	    Debug("Password info = $realpassword\n");
 	    my ($authtype, $contentpwd) = split(/:/, $realpassword);
 	    Debug("Authtype = $authtype, content = $contentpwd\n");
-	    $pf->close; 
+	    $pf->close;
 	    return "$authtype:$contentpwd";
 	} else {
 	    Debug("Opening passwdfile failed");
@@ -8641,7 +8641,7 @@
 
     # Why negative ~pi you may well ask?  Well this function is about
     # authentication, and therefore very important to get right.
-    # I've initialized the flag that determines whether or not I've 
+    # I've initialized the flag that determines whether or not I've
     # validated correctly to a value it's not supposed to get.
     # At the end of this function. I'll ensure that it's not still that
     # value so we don't just wind up returning some accidental value
@@ -8666,7 +8666,7 @@
             if ($domdefaults{'auth_def'} eq 'localauth') {
                 $howpwd = $domdefaults{'auth_def'};
                 $contentpwd = $domdefaults{'auth_arg_def'};
-            } elsif ((($domdefaults{'auth_def'} eq 'krb4') || 
+            } elsif ((($domdefaults{'auth_def'} eq 'krb4') ||
                       ($domdefaults{'auth_def'} eq 'krb5')) &&
                      ($domdefaults{'auth_arg_def'} ne '')) {
                 #
@@ -8714,7 +8714,7 @@
 		    close PWAUTH;
 		    $validated = ! $?;
 
-		} else { 	         # Passwords in /etc/passwd. 
+		} else { 	         # Passwords in /etc/passwd.
 		    $validated = (crypt($password,
 					$contentpwd) eq $contentpwd);
 		}
@@ -8729,7 +8729,7 @@
                 }
             } elsif ($dist =~ /^suse([\d.]+)$/) {
                 if ($1 > 11.1) {
-                    $checkwithkrb5 = 1; 
+                    $checkwithkrb5 = 1;
                 }
             }
             if ($checkwithkrb5) {
@@ -8739,10 +8739,10 @@
             }
 	} elsif ($howpwd eq "krb5") { # User is in kerberos 5 auth. domain.
             $validated = &krb5_authen($password,$null,$user,$contentpwd);
-	} elsif ($howpwd eq "localauth") { 
+	} elsif ($howpwd eq "localauth") {
 	    #  Authenticate via installation specific authentcation method:
-	    $validated = &localauth::localauth($user, 
-					       $password, 
+	    $validated = &localauth::localauth($user,
+					       $password,
 					       $contentpwd,
 					       $domain);
 	    if ($validated < 0) {
@@ -8785,7 +8785,7 @@
                 $defaultcost = 10;
             }
             if (int($rest[0])<int($defaultcost)) {
-                if ($domdefaults{'intauth_check'} == 1) { 
+                if ($domdefaults{'intauth_check'} == 1) {
                     my $ncpass = &hash_passwd($domain,$plainpass);
                     if (&rewrite_password_file($domain,$user,"internal:$ncpass")) {
                         &update_passwd_history($user,$domain,'internal','update cost');
@@ -8958,7 +8958,7 @@
 	}
 	{
 	    my $proname=&propath($cdom,$cname);
-	    if (open(CHATLOG,">>$proname/$logfile")) { 
+	    if (open(CHATLOG,">>$proname/$logfile")) {
 		print CHATLOG ("$time:".&unescape($newchat)."\n");
 	    }
 	    close(CHATLOG);
@@ -8973,25 +8973,25 @@
     my $unsubs = 0;		# Number of successful unsubscribes:
 
 
-    # An old way subscriptions were handled was to have a 
+    # An old way subscriptions were handled was to have a
     # subscription marker file:
 
     Debug("Attempting unlink of $fname.$clientname");
     if (unlink("$fname.$clientname")) {
 	$unsubs++;		# Successful unsub via marker file.
-    } 
+    }
 
     # The more modern way to do it is to have a subscription list
     # file:
 
     if (-e "$fname.subscription") {
 	my $found=&addline($fname,$clientname,$clientip,'');
-	if ($found) { 
+	if ($found) {
 	    $unsubs++;
 	}
-    } 
+    }
 
-    #  If either or both of these mechanisms succeeded in unsubscribing a 
+    #  If either or both of these mechanisms succeeded in unsubscribing a
     #  resource we can return ok:
 
     if($unsubs) {
@@ -9124,10 +9124,10 @@
     print $pf "$user\n$pass\n$pass\n";
     close $pf;
     my $err = $?;
-    return ($err < @passwderrors) ? $passwderrors[$err] : 
+    return ($err < @passwderrors) ? $passwderrors[$err] :
 	"pwchange_falure - unknown error";
 
-    
+
 }
 
 
@@ -9153,7 +9153,7 @@
 	    if($pf) {
 		print $pf "internal:$ncpass\n";
                 $pf->close;
-                &update_passwd_history($uname,$udom,$umode,$action); 
+                &update_passwd_history($uname,$udom,$umode,$action);
 	    } else {
 		$result = "pass_file_failed_error";
 	    }
@@ -9186,7 +9186,7 @@
         my $pf = IO::File->new(">$passfilename");
         if($pf) {
             print $pf "lti:\n";
-            $pf->close; 
+            $pf->close;
             &update_passwd_history($uname,$udom,$umode,$action);
         } else {
             $result = "pass_file_failed_error";
@@ -9211,7 +9211,7 @@
     }
 
     if (!defined($hostid)) { $hostid=$perlvar{'lonHostID'}; }
-    if (&Apache::lonnet::get_host_ip($perlvar{'lonHostID'}) 
+    if (&Apache::lonnet::get_host_ip($perlvar{'lonHostID'})
 	eq &Apache::lonnet::get_host_ip($hostid)) {
 	$currenthostid  =$hostid;
 	$currentdomainid=&Apache::lonnet::host_domain($hostid);
@@ -9614,7 +9614,7 @@
 pushtable requires that the request be encrypted and validated via
 ValidateManager.  The form of the command is:
 enc:pushtable tablename <tablecontents> \n
-where pushtable, tablename and <tablecontents> will be encrypted, but \n is a 
+where pushtable, tablename and <tablecontents> will be encrypted, but \n is a
 cleartext newline.
 
 =item Hanging up (exit or init)
@@ -9674,7 +9674,7 @@
 be sure it does not get worse, Green,and Blue for informational items.
 
 In the discussions below, sometimes reference is made to ~httpd
-when describing file locations.  There isn't really an httpd 
+when describing file locations.  There isn't really an httpd
 user, however there is an httpd directory that gets installed in the
 place that user home directories go.  On linux, this is usually
 (always?) /home/httpd.
@@ -9695,12 +9695,12 @@
 
 =over 2
 
-=item local 
+=item local
 
 The key is written and read from a file.
 This is only valid for connections from localhost.
 
-=item insecure 
+=item insecure
 
 The key is generated by the server and
 transmitted to the client.
@@ -9708,7 +9708,7 @@
 =item  ssl (secure)
 
 An ssl connection is negotiated with the client,
-the key is generated by the server and sent to the 
+the key is generated by the server and sent to the
 client across this ssl connection before the
 ssl connectionis terminated and clear text
 transmission resumes.
@@ -9721,7 +9721,7 @@
 string that is the literal "init:local"  The connection
 is closed and the child exits.
 
-=item Red CRITICAL Can't get key file <error>        
+=item Red CRITICAL Can't get key file <error>
 
 SSL key negotiation is being attempted but the call to
 lonssl::KeyFile failed.  This usually means that the
@@ -9731,7 +9731,7 @@
 <error> is a string that describes the reason that
 the key file could not be located.
 
-=item (Red) CRITICAL  Can't get certificates <error>  
+=item (Red) CRITICAL  Can't get certificates <error>
 
 SSL key negotiation failed because we were not able to retrives our certificate
 or the CA's certificate in the call to lonssl::CertificateFile
@@ -9741,7 +9741,7 @@
 
 =item Apache config file for loncapa  incorrect:
 
-one of the variables 
+one of the variables
 lonCertificateDirectory, lonnetCertificateAuthority, or lonnetCertificate
 undefined or incorrect
 
@@ -9753,22 +9753,22 @@
 
 Files in the directory pointed to by lonCertificateDirectory are not readable by lond.
 
-=item Installation error:                         
+=item Installation error:
 
 Either the certificate authority file or the certificate have not
 been installed in lonCertificateDirectory.
 
-=item (Red) CRITICAL SSL Socket promotion failed:  <err> 
+=item (Red) CRITICAL SSL Socket promotion failed:  <err>
 
 The promotion of the connection from plaintext to SSL failed
 <err> is the reason for the failure.  There are two
-system calls involved in the promotion (one of which failed), 
+system calls involved in the promotion (one of which failed),
 a dup to produce
 a second fd on the raw socket over which the encrypted data
 will flow and IO::SOcket::SSL->new_from_fd which creates
 the SSL connection on the duped fd.
 
-=item (Blue)   WARNING client did not respond to challenge 
+=item (Blue)   WARNING client did not respond to challenge
 
 This occurs on an insecure (non SSL) connection negotiation request.
 lond generates some number from the time, the PID and sends it to
@@ -9776,12 +9776,12 @@
 If the client does not do so, that's a violation of the challenge
 protocols and the connection will be failed.
 
-=item (Red) No manager table. Nobody can manage!!    
+=item (Red) No manager table. Nobody can manage!!
 
 lond has the concept of privileged hosts that
 can perform remote management function such
 as update the hosts.tab.   The manager hosts
-are described in the 
+are described in the
 ~httpd/lonTabs/managers.tab file.
 this message is logged if this file is missing.
 
@@ -9789,15 +9789,15 @@
 =item (Green) Registering manager <dnsname> as <cluster_name> with <ipaddress>
 
 Reports the successful parse and registration
-of a specific manager. 
+of a specific manager.
 
-=item Green existing host <clustername:dnsname>  
+=item Green existing host <clustername:dnsname>
 
 The manager host is already defined in the hosts.tab
 the information in that table, rather than the info in the
 manager table will be used to determine the manager's ip.
 
-=item (Red) Unable to craete <filename>                 
+=item (Red) Unable to craete <filename>
 
 lond has been asked to create new versions of an administrative
 file (by a manager).  When this is done, the new file is created
@@ -9822,23 +9822,23 @@
 The new administrative file could not be installed.  In this case,
 the old administrative file is still in use.
 
-=item (Green) Installed new < filename>.                      
+=item (Green) Installed new < filename>.
 
-The new administrative file was successfullly installed.                                               
+The new administrative file was successfullly installed.
 
-=item (Red) Reinitializing lond pid=<pid>                    
+=item (Red) Reinitializing lond pid=<pid>
 
-The lonc child process <pid> will be sent a USR2 
+The lonc child process <pid> will be sent a USR2
 signal.
 
-=item (Red) Reinitializing self                                    
+=item (Red) Reinitializing self
 
 We've been asked to re-read our administrative files,and
 are doing so.
 
-=item (Yellow) error:Invalid process identifier <ident>  
+=item (Yellow) error:Invalid process identifier <ident>
 
-A reinit command was received, but the target part of the 
+A reinit command was received, but the target part of the
 command was not valid.  It must be either
 'lond' or 'lonc' but was <ident>
 
@@ -9855,13 +9855,13 @@
 
 =item Unable to open <user> passwd to change password
 
-Could not rewrite the 
+Could not rewrite the
 internal password file for a user
 
 =item Result of password change for <user> : <result>
 
-A unix password change for <user> was attempted 
-and the pipe returned <result>  
+A unix password change for <user> was attempted
+and the pipe returned <result>
 
 =item LWP GET: <message> for <fname> (<remoteurl>)
 
@@ -9871,18 +9871,18 @@
 corresponding URI: <remoteurl>  This is emitted in several
 places.
 
-=item Unable to move <transname> to <destname>     
+=item Unable to move <transname> to <destname>
 
 From fetch_user_file_handler - the user file was replicated but could not
 be mv'd to its final location.
 
-=item Looking for <domain> <username>              
+=item Looking for <domain> <username>
 
 From user_has_session_handler - This should be a Debug call instead
-it indicates lond is about to check whether the specified user has a 
+it indicates lond is about to check whether the specified user has a
 session active on the specified domain on the local host.
 
-=item Client <ip> (<name>) hanging up: <input>     
+=item Client <ip> (<name>) hanging up: <input>
 
 lond has been asked to exit by its client.  The <ip> and <name> identify the
 client systemand <input> is the full exit command sent to the server.
@@ -9895,92 +9895,92 @@
 to the best of our ability to get it (I would guess that any numeric value
 represents and errno value).  This is immediately followed by
 
-=item  Famous last words: Catching exception - <log> 
+=item  Famous last words: Catching exception - <log>
 
 Where log is some recent information about the state of the child.
 
-=item Red CRITICAL: TIME OUT <pid>                     
+=item Red CRITICAL: TIME OUT <pid>
 
 Some timeout occured for server <pid>.  THis is normally a timeout on an LWP
 doing an HTTP::GET.
 
-=item child <pid> died                              
+=item child <pid> died
 
 The reaper caught a SIGCHILD for the lond child process <pid>
 This should be modified to also display the IP of the dying child
 $children{$pid}
 
-=item Unknown child 0 died                           
+=item Unknown child 0 died
 A child died but the wait for it returned a pid of zero which really should not
-ever happen. 
+ever happen.
 
-=item Child <which> - <pid> looks like we missed it's death 
+=item Child <which> - <pid> looks like we missed it's death
 
 When a sigchild is received, the reaper process checks all children to see if they are
 alive.  If children are dying quite quickly, the lack of signal queuing can mean
 that a signal hearalds the death of more than one child.  If so this message indicates
 which other one died. <which> is the ip of a dead child
 
-=item Free socket: <shutdownretval>                
+=item Free socket: <shutdownretval>
 
 The HUNTSMAN sub was called due to a SIGINT in a child process.  The socket is being shutdown.
 for whatever reason, <shutdownretval> is printed but in fact shutdown() is not documented
-to return anything. This is followed by: 
+to return anything. This is followed by:
 
-=item Red CRITICAL: Shutting down                       
+=item Red CRITICAL: Shutting down
 
 Just prior to exit.
 
-=item Free socket: <shutdownretval>                 
+=item Free socket: <shutdownretval>
 
 The HUPSMAN sub was called due to a SIGHUP.  all children get killsed, and lond execs itself.
 This is followed by:
 
-=item (Red) CRITICAL: Restarting                         
+=item (Red) CRITICAL: Restarting
 
 lond is about to exec itself to restart.
 
-=item (Blue) Updating connections                        
+=item (Blue) Updating connections
 
 (In response to a USR2).  All the children (except the one for localhost)
 are about to be killed, the hosts tab reread, and Apache reloaded via apachereload.
 
-=item (Blue) UpdateHosts killing child <pid> for ip <ip>   
+=item (Blue) UpdateHosts killing child <pid> for ip <ip>
 
 Due to USR2 as above.
 
-=item (Green) keeping child for ip <ip> (pid = <pid>)    
+=item (Green) keeping child for ip <ip> (pid = <pid>)
 
 In response to USR2 as above, the child indicated is not being restarted because
 it's assumed that we'll always need a child for the localhost.
 
 
-=item Going to check on the children                
+=item Going to check on the children
 
 Parent is about to check on the health of the child processes.
 Note that this is in response to a USR1 sent to the parent lond.
 there may be one or more of the next two messages:
 
-=item <pid> is dead                                 
+=item <pid> is dead
 
 A child that we have in our child hash as alive has evidently died.
 
-=item  Child <pid> did not respond                   
+=item  Child <pid> did not respond
 
 In the health check the child <pid> did not update/produce a pid_.txt
 file when sent it's USR1 signal.  That process is killed with a 9 signal, as it's
 assumed to be hung in some un-fixable way.
 
-=item Finished checking children                   
+=item Finished checking children
 
 Master processs's USR1 processing is cojmplete.
 
-=item (Red) CRITICAL: ------- Starting ------            
+=item (Red) CRITICAL: ------- Starting ------
 
-(There are more '-'s on either side).  Lond has forked itself off to 
+(There are more '-'s on either side).  Lond has forked itself off to
 form a new session and is about to start actual initialization.
 
-=item (Green) Attempting to start child (<client>)       
+=item (Green) Attempting to start child (<client>)
 
 Started a new child process for <client>.  Client is IO::Socket object
 connected to the child.  This was as a result of a TCP/IP connection from a client.
@@ -9991,7 +9991,7 @@
 a zero sized object was returned.  Processing continues, but in my opinion,
 this should be cause for the child to exit.
 
-=item Unable to determine clientip                  
+=item Unable to determine clientip
 
 In child process initialization.  The peer address from getpeername was not defined.
 The client address is stored as "Unavailable" and processing continues.
@@ -10002,21 +10002,21 @@
 
 =over 2
 
-=item <name> 
+=item <name>
 
 is the name of the client from hosts.tab.
 
-=item <type> 
+=item <type>
 
-Is the connection type which is either 
+Is the connection type which is either
 
 =over 2
 
-=item manager 
+=item manager
 
 The connection is from a manager node, not in hosts.tab
 
-=item client  
+=item client
 
 the connection is from a non-manager in the hosts.tab
 
@@ -10033,15 +10033,15 @@
 One of the certificate file, key file or
 certificate authority file could not be found for a client attempting
 SSL connection intiation.  COnnection will be attemptied in in-secure mode.
-(this would be a system with an up to date lond that has not gotten a 
+(this would be a system with an up to date lond that has not gotten a
 certificate from us).
 
-=item (Green)  Successful local authentication            
+=item (Green)  Successful local authentication
 
-A local connection successfully negotiated the encryption key. 
+A local connection successfully negotiated the encryption key.
 In this case the IDEA key is in a file (that is hopefully well protected).
 
-=item (Green) Successful ssl authentication with <client>  
+=item (Green) Successful ssl authentication with <client>
 
 The client (<client> is the peer's name in hosts.tab), has successfully
 negotiated an SSL connection with this child process.
@@ -10051,7 +10051,7 @@
 
 The client has successfully negotiated an  insecure connection withthe child process.
 
-=item (Yellow) Attempted insecure connection disallowed    
+=item (Yellow) Attempted insecure connection disallowed
 
 The client attempted and failed to successfully negotiate a successful insecure
 connection.  This can happen either because the variable londAllowInsecure is false


More information about the LON-CAPA-cvs mailing list