]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 515568: handle_login() doesn't check $@ after eval
authorFrédéric Buclin <LpSolit@gmail.com>
Sat, 6 Feb 2010 17:57:00 +0000 (18:57 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Sat, 6 Feb 2010 17:57:00 +0000 (18:57 +0100)
r/a=mkanat

Bugzilla/WebService/Constants.pm
Bugzilla/WebService/Server.pm
template/en/default/global/code-error.html.tmpl

index 7fd7e2ae8be3cb8d6bbd0116b0ac36cb9fc9b3d4..a51389faa8460947ea2ac678f4fc98f004313da0 100644 (file)
@@ -112,6 +112,8 @@ use constant WS_ERROR_CODE => {
     invalid_user_group    => 504,
     user_access_by_id_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.
index 115c7df8962fe3de64516a5451c193091939145a..9571e80307f9fb59038322fda24ad85f9f14a574 100644 (file)
 package Bugzilla::WebService::Server;
 use strict;
 
+use Bugzilla::Error;
+
 sub handle_login {
     my ($self, $class, $method, $full_method) = @_;
     eval "require $class";
+    ThrowCodeError('unknown_method', {method => $full_method}) if $@;
     return if ($class->login_exempt($method) 
                and !defined Bugzilla->input_params->{Bugzilla_login});
     Bugzilla->login();
index 2c2eb9891610b0cd03843381b3c96360b29ce307..b8a87fb58b0c5015c0a77a1c98d59db0be0d991f 100644 (file)
        I could not figure out what you wanted to do.
     [% END %]
 
+  [% ELSIF error == "unknown_method" %]
+    The requested method '[% method FILTER html %]' was not found.
+
   [% ELSIF error == "usage_mode_invalid" %]
     '[% invalid_usage_mode FILTER html %]' is not a valid usage mode.