Navigation Menu

Skip to content

Commit

Permalink
Protect tempfile creation code against symlink race attacks
Browse files Browse the repository at this point in the history
  • Loading branch information
FooBarWidget committed May 30, 2018
1 parent 00c3eb5 commit a9062c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/daemon_controller.rb
Expand Up @@ -646,8 +646,8 @@ def is_std_channel_chardev?(path)
def run_command_while_capturing_output(command)
# Create tempfile for storing the command's output.
tempfile = Tempfile.new('daemon-output')
tempfile.chmod(0666)
tempfile_path = tempfile.path
File.chmod(0666, tempfile_path)
tempfile.close

if self.class.fork_supported? || self.class.spawn_supported?
Expand Down

0 comments on commit a9062c2

Please sign in to comment.