Commit fcf51896 authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 515568: handle_login() doesn't check $@ after eval

r/a=mkanat
parent a4362815
...@@ -112,6 +112,8 @@ use constant WS_ERROR_CODE => { ...@@ -112,6 +112,8 @@ use constant WS_ERROR_CODE => {
invalid_user_group => 504, invalid_user_group => 504,
user_access_by_id_denied => 505, user_access_by_id_denied => 505,
user_access_by_match_denied => 505, user_access_by_match_denied => 505,
# Fatal errors (must be negative).
unknown_method => -32601,
}; };
# These are the fallback defaults for errors not in ERROR_CODE. # These are the fallback defaults for errors not in ERROR_CODE.
......
...@@ -18,9 +18,12 @@ ...@@ -18,9 +18,12 @@
package Bugzilla::WebService::Server; package Bugzilla::WebService::Server;
use strict; use strict;
use Bugzilla::Error;
sub handle_login { sub handle_login {
my ($self, $class, $method, $full_method) = @_; my ($self, $class, $method, $full_method) = @_;
eval "require $class"; eval "require $class";
ThrowCodeError('unknown_method', {method => $full_method}) if $@;
return if ($class->login_exempt($method) return if ($class->login_exempt($method)
and !defined Bugzilla->input_params->{Bugzilla_login}); and !defined Bugzilla->input_params->{Bugzilla_login});
Bugzilla->login(); Bugzilla->login();
......
...@@ -483,6 +483,9 @@ ...@@ -483,6 +483,9 @@
I could not figure out what you wanted to do. I could not figure out what you wanted to do.
[% END %] [% END %]
[% ELSIF error == "unknown_method" %]
The requested method '[% method FILTER html %]' was not found.
[% ELSIF error == "usage_mode_invalid" %] [% ELSIF error == "usage_mode_invalid" %]
'[% invalid_usage_mode FILTER html %]' is not a valid usage mode. '[% invalid_usage_mode FILTER html %]' is not a valid usage mode.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment