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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 25 Aug 2003 15:33:47 -0000


albertel		Mon Aug 25 11:33:47 2003 EDT

  Modified files:              
    /loncom	lond 
  Log:
  - trying to change internal password 
  
  
Index: loncom/lond
diff -u loncom/lond:1.138 loncom/lond:1.139
--- loncom/lond:1.138	Fri Aug 22 12:07:11 2003
+++ loncom/lond	Mon Aug 25 11:33:47 2003
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.138 2003/08/22 16:07:11 albertel Exp $
+# $Id: lond,v 1.139 2003/08/25 15:33:47 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -81,7 +81,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.138 $'; #' stupid emacs
+my $VERSION='$Revision: 1.139 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid;
 my $currentdomainid;
@@ -818,10 +818,18 @@
 			     my $salt=time;
                              $salt=substr($salt,6,2);
 			     my $ncpass=crypt($npass,$salt);
-                             { my $pf = IO::File->new(">$passfilename");
- 	  		       print $pf "internal:$ncpass\n"; }             
-			     &logthis("Result of password change for $uname: pwchange_success");
-                             print $client "ok\n";
+                             {
+				 my $pf;
+				 if ($pf = IO::File->new(">$passfilename")) {
+				     print $pf "internal:$ncpass\n";
+				     &logthis("Result of password change for $uname: pwchange_success");
+				     print $client "ok\n";
+				 } else {
+				     &logthis("Unable to open $uname passwd to change password");
+				     print $client "non_authorized\n";
+				 }
+			     }             
+			     
                            } else {
                              print $client "non_authorized\n";
                            }