]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 907438 - In MySQL, login cookie checking is not case-sensitive, reducing total...
authorDave Lawrence <dlawrence@mozilla.com>
Wed, 16 Oct 2013 16:14:11 +0000 (12:14 -0400)
committerDave Lawrence <dlawrence@mozilla.com>
Wed, 16 Oct 2013 16:14:11 +0000 (12:14 -0400)
r=LpSolit,a=sgreen

Bugzilla/Auth/Login/Cookie.pm

index 91fb820fb58380706f0ad97b090b5621b93123f7..de9188c64a76d80fc0f0f0ed27c4223ff56cd98c 100644 (file)
@@ -60,8 +60,8 @@ sub get_login_info {
         trick_taint($login_cookie);
         detaint_natural($user_id);
 
-        my $is_valid =
-          $dbh->selectrow_array('SELECT 1
+        my $db_cookie =
+          $dbh->selectrow_array('SELECT cookie
                                    FROM logincookies
                                   WHERE cookie = ?
                                         AND userid = ?
@@ -69,7 +69,7 @@ sub get_login_info {
                                  undef, ($login_cookie, $user_id, $ip_addr));
 
         # If the cookie is valid, return a valid username.
-        if ($is_valid) {
+        if (defined $db_cookie && $login_cookie eq $db_cookie) {
             # If we logged in successfully, then update the lastused 
             # time on the login cookie
             $dbh->do("UPDATE logincookies SET lastused = NOW()