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
d10ad549
Commit
d10ad549
authored
Mar 05, 2005
by
mkanat%kerio.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 284838: editvalues.cgi does not use $dbh->bz_(un)lock_tables
Patch By Max Kanat-Alexander <mkanat@kerio.com> r=LpSolit, a=justdave
parent
ec610fd6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
editvalues.cgi
editvalues.cgi
+6
-6
No files found.
editvalues.cgi
View file @
d10ad549
...
...
@@ -253,6 +253,8 @@ if ($action eq 'delete') {
trick_taint
(
$field
);
trick_taint
(
$value
);
$dbh
->
bz_lock_tables
(
'bugs READ'
,
"$field WRITE"
);
# Check if there are any bugs that still have this value.
my
$bug_ids
=
$dbh
->
selectcol_arrayref
(
"SELECT bug_id FROM bugs WHERE $field = ?"
,
undef
,
$value
);
...
...
@@ -260,7 +262,6 @@ if ($action eq 'delete') {
if
(
scalar
(
@$bug_ids
))
{
# You tried to delete a field that bugs are still using.
# You can't just delete the bugs. That's ridiculous.
$dbh
->
do
(
'UNLOCK TABLES'
);
ThrowUserError
(
"fieldvalue_still_has_bugs"
,
{
field
=>
$field
,
value
=>
$value
,
count
=>
scalar
(
@$bug_ids
)
});
...
...
@@ -268,6 +269,8 @@ if ($action eq 'delete') {
$dbh
->
do
(
"DELETE FROM $field WHERE value = ?"
,
undef
,
$value
);
$dbh
->
bz_unlock_tables
();
unlink
"$datadir/versioncache"
;
$vars
->
{
'value'
}
=
$value
;
...
...
@@ -318,7 +321,7 @@ if ($action eq 'update') {
{
'value'
=>
$value
});
}
$dbh
->
do
(
"LOCK TABLES bugs WRITE,
$field WRITE"
);
$dbh
->
bz_lock_tables
(
'bugs WRITE'
,
"
$field WRITE"
);
# Need to store because detaint_natural() will delete this if
# invalid
...
...
@@ -326,7 +329,6 @@ if ($action eq 'update') {
if
(
$sortkey
!=
$sortkeyold
)
{
if
(
!
detaint_natural
(
$sortkey
))
{
$dbh
->
do
(
'UNLOCK TABLES'
);
ThrowUserError
(
'fieldvalue_sortkey_invalid'
,
{
'name'
=>
$field
,
'sortkey'
=>
$stored_sortkey
});
...
...
@@ -344,11 +346,9 @@ if ($action eq 'update') {
if
(
$value
ne
$valueold
)
{
unless
(
$value
)
{
$dbh
->
do
(
'UNLOCK TABLES'
);
ThrowUserError
(
'fieldvalue_undefined'
);
}
if
(
ValueExists
(
$field
,
$value
))
{
$dbh
->
do
(
'UNLOCK TABLES'
);
ThrowUserError
(
'fieldvalue_already_exists'
,
{
'value'
=>
$value
,
'field'
=>
$field
});
...
...
@@ -366,7 +366,7 @@ if ($action eq 'update') {
$vars
->
{
'updated_value'
}
=
1
;
}
$dbh
->
do
(
'UNLOCK TABLES'
);
$dbh
->
bz_unlock_tables
(
);
$vars
->
{
'value'
}
=
$value
;
$vars
->
{
'field'
}
=
$field
;
...
...
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