From e06e3ecae774e1b5436ed8aaced2cf5abc7c28d6 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Fri, 18 Nov 2011 10:31:31 +0000 Subject: [PATCH] Make Login/Stack.pm refuse to continue down the stack if an Auth method returns an explicit failure. r=dkl, a=mkanat. git-svn-id: svn://10.0.0.236/trunk@263083 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Stack.pm | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index a88e2e5cba5..83ae3ec456b 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -8001 \ No newline at end of file +8002 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Stack.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Stack.pm index 0f3661954a5..e8d9c46350c 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Stack.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Stack.pm @@ -28,6 +28,7 @@ use fields qw( ); use Hash::Util qw(lock_keys); use Bugzilla::Hook; +use Bugzilla::Constants; use List::MoreUtils qw(any); sub new { @@ -60,8 +61,13 @@ sub get_login_info { } $result = $object->get_login_info(@_); $self->{successful} = $object; - last if !$result->{failure}; - # So that if none of them succeed, it's undef. + + # We only carry on down the stack if this method denied all knowledge. + last unless ($result->{failure} + && ($result->{failure} eq AUTH_NODATA + || $result->{failure} eq AUTH_NO_SUCH_USER)); + + # If none of the methods succeed, it's undef. $self->{successful} = undef; } return $result;