Opened 12 years ago

Closed 12 years ago

#4830 closed defect (fixed)

Always umask before calling mkstemp()

Reported by: Erik Hovland <erik@…> Owned by: danielk
Priority: minor Milestone: 0.22
Component: mythtv Version: 0.21-fixes
Severity: low Keywords:
Cc: Ticket locked: no

Description

Using mkstemp() is extremely good practice. Round of applause for mythtv being diligent about that. But when using mkstemp, it is always a good idea to set the process umask to a known safe value before using it. The call createTempFile() doesn't set the umask before calling. It should.

Attachments (1)

libs_libmyth_util.cpp-umask-before-mkstemp.patch (610 bytes) - added by Erik Hovland <erik@…> 12 years ago.
sets umask before mkstemp and then sets it back

Download all attachments as: .zip

Change History (4)

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

sets umask before mkstemp and then sets it back

comment:1 Changed 12 years ago by Isaac Richards

Milestone: 0.210.22

comment:2 Changed 12 years ago by danielk

Owner: changed from Isaac Richards to danielk
Status: newassigned

comment:3 Changed 12 years ago by danielk

Resolution: fixed
Status: assignedclosed

(In [16880]) Fixes #4830. Make temporary files only usable by user creating them.

This is a pretty simple trivial patch, but I wanted to test it with mythfilldatabase before applying. It appears to have no ill effects.

Note: See TracTickets for help on using tickets.