Modify

Ticket #4830 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

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

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

Change History

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

sets umask before mkstemp and then sets it back

comment:1 Changed 4 years ago by ijr

  • Milestone changed from 0.21 to 0.22

comment:2 Changed 4 years ago by danielk

  • Owner changed from ijr to danielk
  • Status changed from new to assigned

comment:3 Changed 4 years ago by danielk

  • Status changed from assigned to closed
  • Resolution set to fixed

(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.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.