]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 395632: [SECURITY] XML-RPC WebService Bugzilla::User::offer_account_by_email...
authormkanat%bugzilla.org <>
Wed, 19 Sep 2007 04:30:20 +0000 (04:30 +0000)
committermkanat%bugzilla.org <>
Wed, 19 Sep 2007 04:30:20 +0000 (04:30 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat

Bugzilla/WebService/Constants.pm
Bugzilla/WebService/User.pm

index 5e255d4be3ebd6aa2c6ad76c3ec1c9d8db3e4208..0b73114dfbe6d8c30cb0018c940659bcee192bbe 100755 (executable)
@@ -84,6 +84,7 @@ use constant WS_ERROR_CODE => {
     # User errors are 500-600.
     account_exists        => 500,
     illegal_email_address => 501,
+    account_creation_disabled   => 501,
     password_too_short    => 502,
     password_too_long     => 503,
     invalid_username      => 504,
index db02ff75ae65f6d04d1fc6f1869c0992add7c10f..12ca0a4ce12794f4bfe1a200514e676e873606c4 100755 (executable)
@@ -74,6 +74,11 @@ sub offer_account_by_email {
     my $email = trim($params->{email})
         || ThrowCodeError('param_required', { param => 'email' });
 
+    my $createexp = Bugzilla->params->{'createemailregexp'};
+    if (!$createexp || $email !~ /$createexp/) {
+        ThrowUserError("account_creation_disabled");
+    }
+
     $email = Bugzilla::User->check_login_name_for_creation($email);
 
     # Create and send a token for this new account.