diff options
author | Byron Jones <glob@mozilla.com> | 2015-03-05 12:57:53 +0800 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-03-05 12:57:53 +0800 |
commit | c1fa559e16cbaa5e7a3133f7ea0b086ea00ba650 (patch) | |
tree | 063acc63c823e66b4ab8cd04802139548905a1ee /Bugzilla/Token.pm | |
parent | dbc7a21e1b96a9c57b6a53af78a4d467c9a7672d (diff) | |
download | bugs-c1fa559e16cbaa5e7a3133f7ea0b086ea00ba650.tar bugs-c1fa559e16cbaa5e7a3133f7ea0b086ea00ba650.tar.gz bugs-c1fa559e16cbaa5e7a3133f7ea0b086ea00ba650.tar.bz2 bugs-c1fa559e16cbaa5e7a3133f7ea0b086ea00ba650.tar.xz bugs-c1fa559e16cbaa5e7a3133f7ea0b086ea00ba650.zip |
Bug 1128853: Bugzilla shouldn't try to write API tokens into the shadow DB
r=dkl,a=glob
Diffstat (limited to 'Bugzilla/Token.pm')
-rw-r--r-- | Bugzilla/Token.pm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm index 24ffad3c3..84d86b8c6 100644 --- a/Bugzilla/Token.pm +++ b/Bugzilla/Token.pm @@ -432,6 +432,9 @@ sub _create_token { trick_taint($tokentype); trick_taint($eventdata); + my $is_shadow = Bugzilla->is_shadow_db; + $dbh = Bugzilla->switch_to_main_db() if $is_shadow; + $dbh->bz_start_transaction(); my $token = GenerateUniqueToken(); @@ -444,8 +447,10 @@ sub _create_token { if (wantarray) { my (undef, $token_ts, undef) = GetTokenData($token); $token_ts = str2time($token_ts); + Bugzilla->switch_to_shadow_db() if $is_shadow; return ($token, $token_ts); } else { + Bugzilla->switch_to_shadow_db() if $is_shadow; return $token; } } |