Closed Bug 186173 Opened 22 years ago Closed 22 years ago

attachment.cgi must LOCK groups

Categories

(Bugzilla :: Attachments & Requests, defect, P1)

2.17.1
Other
Other
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: bugreport, Assigned: bugreport)

Details

Since attachment.cgi needs to check group permissions for users that may require a rederive, it needs to LOCK groups at the same time it locks everything else. In fixing this, watch for nested locks!!!
OK... fundamental bbaetz question.... Functions that need to lock tables will be called from within other functions that lock tables. The simplest thing to do would be to have the enclosing LOCK include all the locks needed for enclosed functions and then have a global lock_counter. So, I replace... LOCK whatever with if ($::lockcount == 0) { LOCK whatever $::lockcount = 1; } else { $::lockcount++; } and replace UNLOCK TABLES with if ($::lockcount == 1) { UNLOCK TABLES $::lockcount = 0; } else { $::lockcount--; } Would this be the right approach?
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → Bugzilla 2.18
Doh! This was caused by a site hack.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
Target Milestone: Bugzilla 2.18 → ---
> Functions that need to lock tables will be called from within other functions > that lock tables. Ideally, noone should be locking any table. SELECT FOR UPDATE + transactions would do this for us. So lets leave this problem until we do need to worry :)
Severity: critical → trivial
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.