--- loncom/lond 2003/08/22 16:07:11 1.138 +++ loncom/lond 2003/08/25 15:33:47 1.139 @@ -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 $DEBUG = 0; # Non zero to ena 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 @@ sub make_new_child { 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"; }