Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
36f7289d
Commit
36f7289d
authored
Nov 04, 2013
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 926952: Possible race conditions when editing or deleting a milestone or a version
r/a=glob
parent
d85bcb2b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
Milestone.pm
Bugzilla/Milestone.pm
+9
-2
Version.pm
Bugzilla/Version.pm
+5
-1
No files found.
Bugzilla/Milestone.pm
View file @
36f7289d
...
...
@@ -97,10 +97,12 @@ sub run_create_validators {
sub
update
{
my
$self
=
shift
;
my
$dbh
=
Bugzilla
->
dbh
;
$dbh
->
bz_start_transaction
();
my
$changes
=
$self
->
SUPER::
update
(
@_
);
if
(
exists
$changes
->
{
value
})
{
my
$dbh
=
Bugzilla
->
dbh
;
# The milestone value is stored in the bugs table instead of its ID.
$dbh
->
do
(
'UPDATE bugs SET target_milestone = ?
WHERE target_milestone = ? AND product_id = ?'
,
...
...
@@ -111,6 +113,8 @@ sub update {
WHERE id = ? AND defaultmilestone = ?'
,
undef
,
(
$self
->
name
,
$self
->
product_id
,
$changes
->
{
value
}
->
[
0
]));
}
$dbh
->
bz_commit_transaction
();
return
$changes
;
}
...
...
@@ -118,6 +122,8 @@ sub remove_from_db {
my
$self
=
shift
;
my
$dbh
=
Bugzilla
->
dbh
;
$dbh
->
bz_start_transaction
();
# The default milestone cannot be deleted.
if
(
$self
->
name
eq
$self
->
product
->
default_milestone
)
{
ThrowUserError
(
'milestone_is_default'
,
{
milestone
=>
$self
});
...
...
@@ -146,8 +152,9 @@ sub remove_from_db {
Bugzilla
->
user
->
id
,
$timestamp
);
}
}
$self
->
SUPER::
remove_from_db
();
$dbh
->
bz_commit_transaction
();
}
################################
...
...
Bugzilla/Version.pm
View file @
36f7289d
...
...
@@ -117,14 +117,18 @@ sub bug_count {
sub
update
{
my
$self
=
shift
;
my
$dbh
=
Bugzilla
->
dbh
;
$dbh
->
bz_start_transaction
();
my
(
$changes
,
$old_self
)
=
$self
->
SUPER::
update
(
@_
);
if
(
exists
$changes
->
{
value
})
{
my
$dbh
=
Bugzilla
->
dbh
;
$dbh
->
do
(
'UPDATE bugs SET version = ?
WHERE version = ? AND product_id = ?'
,
undef
,
(
$self
->
name
,
$old_self
->
name
,
$self
->
product_id
));
}
$dbh
->
bz_commit_transaction
();
return
$changes
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment