--- loncom/lcpasswd 2001/11/15 18:34:57 1.13 +++ loncom/lcpasswd 2002/08/30 13:37:59 1.16 @@ -10,8 +10,11 @@ # # YEAR=2001 # 10/22,10/23,11/13,11/15 Scott Harrison +# +# YEAR=2002 +# 02/19 Matthew Hall # -# $Id: lcpasswd,v 1.13 2001/11/15 18:34:57 harris41 Exp $ +# $Id: lcpasswd,v 1.16 2002/08/30 13:37:59 matthew Exp $ ### ############################################################################### @@ -44,7 +47,7 @@ use strict; # # Standard input usage # First line is USERNAME -# Second line is CURRENT PASSWORD +# Second line is NEW PASSWORD # Third line is NEW PASSWORD # # Valid passwords must consist of the @@ -120,7 +123,7 @@ if (@input!=3) { unlink('/tmp/lock_lcpasswd'); exit 3; } -map {chomp} @input; +foreach (@input) {chomp;} my ($username,$password1,$password2)=@input; $username=~/^(\w+)$/; @@ -131,8 +134,8 @@ if (($username ne $safeusername) or ($sa exit 9; } my $pbad=0; -map {if (($_<32)&&($_>126)){$pbad=1;}} (split(//,$password1)); -map {if (($_<32)&&($_>126)){$pbad=1;}} (split(//,$password2)); +foreach (split(//,$password1)) {if ((ord($_)<32)||(ord($_)>126)){$pbad=1;}} +foreach (split(//,$password2)) {if ((ord($_)<32)||(ord($_)>126)){$pbad=1;}} if ($pbad) { print "Error. A password entry had an invalid character.\n"; unlink('/tmp/lock_lcpasswd');