--- loncom/lond 2004/08/05 11:37:05 1.223 +++ loncom/lond 2004/08/06 10:27:53 1.224 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.223 2004/08/05 11:37:05 foxr Exp $ +# $Id: lond,v 1.224 2004/08/06 10:27:53 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -57,7 +57,7 @@ my $DEBUG = 1; # Non zero to ena my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.223 $'; #' stupid emacs +my $VERSION='$Revision: 1.224 $'; #' stupid emacs my $remoteVERSION; my $currenthostid="default"; my $currentdomainid; @@ -194,8 +194,7 @@ sub LocalConnection { ."$clientdns ne $thisserver "); close $Socket; return undef; - } - else { + } else { chomp($initcmd); # Get rid of \n in filename. my ($init, $type, $name) = split(/:/, $initcmd); Debug(" Init command: $init $type $name "); @@ -326,8 +325,7 @@ sub InsecureConnection { $answer =~s/\W//g; if($challenge eq $answer) { return 1; - } - else { + } else { logthis("WARNING client did not respond to challenge"); &status("No challenge reqply"); return 0; @@ -656,8 +654,7 @@ sub PushFile { &logthis(' Pushfile: unable to install ' .$tablefile." $! "); return "error:$!"; - } - else { + } else { &logthis(' Installed new '.$tablefile .""); @@ -1503,8 +1500,7 @@ sub change_password_handler { &Failure( $client, "auth_mode_error\n", $userinput); } - } - else { + } else { &Failure( $client, "non_authorized\n", $userinput); } @@ -2495,8 +2491,7 @@ sub process_request { print $store2 "done\n"; close $store2; print $client "ok\n"; - } - else { + } else { print $client "error: ".($!+0) ." IO::File->new Failed ". "while attempting queryreply\n"; @@ -3694,8 +3689,7 @@ sub make_new_child { $inittype = ""; # This forces insecure attempt. &logthis(" Certificates not " ."installed -- trying insecure auth"); - } - else { # SSL certificates are in place so + } else { # SSL certificates are in place so } # Leave the inittype alone. } @@ -3929,8 +3923,7 @@ sub get_auth_type } return "$authtype:$availinfo"; - } - else { + } else { Debug("Returning nouser"); return "nouser"; } @@ -4010,18 +4003,15 @@ sub validate_user { $password); if(!$k4error) { $validated = 1; - } - else { + } else { $validated = 0; &logthis('krb4: '.$user.', '.$contentpwd.', '. &Authen::Krb4::get_err_txt($Authen::Krb4::error)); } - } - else { + } else { $validated = 0; # Password has a match with null. } - } - elsif ($howpwd eq "krb5") { # User is in kerberos 5 auth. domain. + } elsif ($howpwd eq "krb5") { # User is in kerberos 5 auth. domain. if(!($password =~ /$null/)) { # Null password not allowed. my $krbclient = &Authen::Krb5::parse_name($user.'@' .$contentpwd); @@ -4034,18 +4024,15 @@ sub validate_user { $password, $credentials); $validated = ($krbreturn == 1); - } - else { + } else { $validated = 0; } - } - elsif ($howpwd eq "localauth") { + } elsif ($howpwd eq "localauth") { # Authenticate via installation specific authentcation method: $validated = &localauth::localauth($user, $password, $contentpwd); - } - else { # Unrecognized auth is also bad. + } else { # Unrecognized auth is also bad. $validated = 0; } } else { @@ -4308,7 +4295,8 @@ sub make_passwd_file { } my $execpath ="$perlvar{'lonDaemons'}/"."lcuseradd"; - my $lc_error_file = "/tmp/lcuseradd".$$.".status"; + + my $lc_error_file = $execdir."/tmp/lcuseradd".$$.".status"; { &Debug("Executing external: ".$execpath); &Debug("user = ".$uname.", Password =". $npass); @@ -4329,8 +4317,7 @@ sub make_passwd_file { my $error_text = &lcuseraddstrerror($useraddok); &logthis("Failed lcuseradd: $error_text"); $result = "lcuseradd_failed:$error_text\n"; - } - else { + } else { my $pf = IO::File->new(">$passfilename"); print $pf "unix:\n"; }