]> 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:15:20 +0000 (12:15 -0400)
committerDave Lawrence <dlawrence@mozilla.com>
Wed, 16 Oct 2013 16:15:20 +0000 (12:15 -0400)
r=LpSolit,a=sgreen

Bugzilla/Auth/Login/Cookie.pm

index 5d4c8279ce6535c9a211f5d133a99bb62845341b..274e064ff196f459f4d73acb064b611a6eab6e8d 100644 (file)
@@ -50,8 +50,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 = ?
@@ -59,7 +59,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()