Issue Details (XML | Word | Printable)

Key: MDL-5956
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Eloy Lafuente (stronk7)
Reporter: Penny Leach
Votes: 0
Watchers: 5
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

race condition in calendar

Created: 29/Jun/06 07:12 AM   Updated: 29/Dec/07 04:59 AM
Return to search
Component/s: Calendar
Affects Version/s: 1.6
Fix Version/s: 1.6.6, 1.7.4, 1.8.4, 1.9

Environment: All

Participants: Eloy Lafuente (stronk7), Martin Dougiamas, Martín Langhoff and Penny Leach
Security Level: None
Resolved date: 29/Dec/07
Affected Branches: MOODLE_16_STABLE
Fixed Branches: MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
I've just realised there's quite a serious race condition for how repeat events are handled in the calendar. I thought the repeatid column just pointed to the id of the original event.


But, no:

if ($form->repeat) {
   $fetch = get_record_sql('SELECT 1, MAX(repeatid) AS repeatid FROM '.$CFG->prefix.'event');
   $form->repeatid = empty($fetch) ? 1 : $fetch->repeatid + 1;
}

cvs:/calendar/edit.php

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eloy Lafuente (stronk7) committed 2 files to 'Moodle CVS' on branch 'MOODLE_16_STABLE' - 29/Dec/07 03:35 AM
Prevent race condition in event creation. MDL-5956.
Credit goes to Penny, Luke and Martin @ Catalyst.
MODIFY backup/restorelib.php   Rev. 1.166.6.5    (+17 -14 lines)
MODIFY calendar/event.php   Rev. 1.50.6.2    (+7 -6 lines)
Eloy Lafuente (stronk7) committed 2 files to 'Moodle CVS' on branch 'MOODLE_17_STABLE' - 29/Dec/07 03:37 AM
Prevent race condition in event creation. MDL-5956.
Credit goes to Penny, Luke and Martin @ Catalyst.

Merged from MOODLE_16_STABLE
MODIFY calendar/event.php   Rev. 1.56.2.6    (+6 -5 lines)
MODIFY backup/restorelib.php   Rev. 1.197.2.22    (+17 -14 lines)
Eloy Lafuente (stronk7) committed 2 files to 'Moodle CVS' on branch 'MOODLE_18_STABLE' - 29/Dec/07 03:39 AM
Prevent race condition in event creation. MDL-5956.
Credit goes to Penny, Luke and Martin @ Catalyst.

Merged from MOODLE_17_STABLE
MODIFY backup/restorelib.php   Rev. 1.218.2.32    (+17 -14 lines)
MODIFY calendar/event.php   Rev. 1.63.2.7    (+7 -6 lines)
Eloy Lafuente (stronk7) committed 2 files to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 29/Dec/07 03:57 AM
Prevent race condition in event creation. MDL-5956.
Credit goes to Penny, Luke and Martin @ Catalyst.

Merged from MOODLE_18_STABLE
MODIFY backup/restorelib.php   Rev. 1.283.2.13    (+17 -14 lines)
MODIFY calendar/event.php   Rev. 1.74.2.2    (+7 -6 lines)
Eloy Lafuente (stronk7) committed 2 files to 'Moodle CVS' - 29/Dec/07 04:14 AM
Prevent race condition in event creation. MDL-5956.
Credit goes to Penny, Luke and Martin @ Catalyst.

Merged from MOODLE_19_STABLE
MODIFY calendar/event.php   Rev. 1.76    (+7 -6 lines)
MODIFY backup/restorelib.php   Rev. 1.299    (+17 -14 lines)