From: terry%mozilla.org <> Date: Tue, 18 Jan 2000 22:40:18 +0000 (+0000) Subject: Stop ever using perl's crypt() function; only use mysql's. (Using X-Git-Tag: bugzilla-2.12~456 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca8760339069c50ccbdcf3d92e416f7d1522adf8;p=thirdparty%2Fbugzilla.git Stop ever using perl's crypt() function; only use mysql's. (Using both was causing corruption on about 1 in 40 passwords.) --- diff --git a/CGI.pl b/CGI.pl index 41667dd2cb..5f7a21f882 100644 --- a/CGI.pl +++ b/CGI.pl @@ -604,7 +604,10 @@ sub confirm_login { exit; } - my $enteredcryptpwd = crypt($enteredpwd, substr($realcryptpwd, 0, 2)); + SendSQL("SELECT encrypt(" . SqlQuote($enteredpwd) . ", " . + SqlQuote(substr($realcryptpwd, 0, 2)) . ")"); + my $enteredcryptpwd = FetchOneColumn(); + if ($realcryptpwd eq "" || $enteredcryptpwd ne $realcryptpwd) { print "Content-type: text/html\n\n"; PutHeader("Login failed"); diff --git a/changepassword.cgi b/changepassword.cgi index d62259ac5f..93b736e55b 100755 --- a/changepassword.cgi +++ b/changepassword.cgi @@ -102,11 +102,6 @@ The two passwords you entered did not match. Please click Back and try a my $pwd = $::FORM{'pwd1'}; -sub x { - my $sc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./"; - return substr($sc, int (rand () * 100000) % (length ($sc) + 1), 1); -} - if ($pwd ne "") { if ($pwd !~ /^[a-zA-Z0-9-_]*$/ || length($pwd) < 3 || length($pwd) > 15) { print "