Opened 11 years ago

Closed 11 years ago

#5704 closed defect (fixed)

avoid potential file race between stat and open in DVDProbe::probe

Reported by: Erik Hovland <erik@…> Owned by: Anduin Withers
Priority: trivial Milestone: unknown
Component: mythvideo Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

when using stat before any file action function (open, unlink, etc) there is the possibility for a race. Because both functions use strings that represent file names. So it makes more sense to either do the action first and deal with the error state or to try to use alternatives like Qt's QFile object. I chose the later in the attached patch.

Attachments (2)

mythvideo-file-race.patch (2.0 KB) - added by Erik Hovland <erik@…> 11 years ago.
changes DVDProbe::probe to use QFile instead of stat and open.
mythplugins_mythvideo-file-race.patch (3.6 KB) - added by Erik Hovland <erik@…> 11 years ago.
Latest version of the patch against trunk as of 2008-12-06

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by Erik Hovland <erik@…>

Attachment: mythvideo-file-race.patch added

changes DVDProbe::probe to use QFile instead of stat and open.

comment:1 Changed 11 years ago by Erik Hovland <erik@…>

Doh, filed this under mythtv. Should be mythvideo. Please change.

comment:2 Changed 11 years ago by paulh

Component: mythtvmythvideo
Owner: changed from Isaac Richards to Anduin Withers

comment:3 Changed 11 years ago by Dibblah

Status: newassigned

Changed 11 years ago by Erik Hovland <erik@…>

Latest version of the patch against trunk as of 2008-12-06

comment:4 Changed 11 years ago by danielk

Resolution: fixed
Status: assignedclosed

(In [19450]) Fixes #5704. Fixes a race conditon in DVD handling & replaces stat() call with QFile.

Note: See TracTickets for help on using tickets.