[LON-CAPA-cvs] cvs: loncom / lcpasswd pwchange

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 19 Feb 2002 21:51:09 -0000


matthew		Tue Feb 19 16:51:09 2002 EDT

  Modified files:              
    /loncom	lcpasswd pwchange 
  Log:
  Fixed silly bug in checking for invalid password characters.
  
  
Index: loncom/lcpasswd
diff -u loncom/lcpasswd:1.14 loncom/lcpasswd:1.15
--- loncom/lcpasswd:1.14	Thu Feb 14 17:09:14 2002
+++ loncom/lcpasswd	Tue Feb 19 16:51:09 2002
@@ -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.14 2002/02/14 22:09:14 harris41 Exp $
+# $Id: lcpasswd,v 1.15 2002/02/19 21:51:09 matthew Exp $
 ###
 
 ###############################################################################
@@ -131,8 +134,8 @@
     exit 9;
 }
 my $pbad=0;
-foreach (split(//,$password1)) {if (($_<32)&&($_>126)){$pbad=1;}}
-foreach (split(//,$password2)) {if (($_<32)&&($_>126)){$pbad=1;}}
+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');
Index: loncom/pwchange
diff -u loncom/pwchange:1.5 loncom/pwchange:1.6
--- loncom/pwchange:1.5	Fri Nov 16 01:10:41 2001
+++ loncom/pwchange	Tue Feb 19 16:51:09 2002
@@ -7,7 +7,10 @@
 # YEAR=2001
 # 10/23,11/13,11/15 Scott Harrison
 #
-# $Id: pwchange,v 1.5 2001/11/16 06:10:41 harris41 Exp $
+# YEAR=2002
+# 02/19 Matthew Hall
+#
+# $Id: pwchange,v 1.6 2002/02/19 21:51:09 matthew Exp $
 ###
 
 use strict;
@@ -37,7 +40,7 @@
 }
 
 my $pbad=0;
-map {if (($_<32)&&($_>126)){$pbad=1;}} (split(//,$pword));
+foreach (split(//,$pword)) {if ((ord($_)<32)||(ord($_)>126)){$pbad=1;}} 
 exit 3 if $pbad;
 
 # --------------------------------------------------------- Call system command