From 002e0ca4280f757bdf30f20c5ed88220059af234 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 5 Nov 2018 02:25:46 +0000 Subject: [PATCH] Create MJIT header with strict permission git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/transform_mjit_header.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tool/transform_mjit_header.rb b/tool/transform_mjit_header.rb index 4784a47299..91e4a971d2 100644 --- a/tool/transform_mjit_header.rb +++ b/tool/transform_mjit_header.rb @@ -148,8 +148,10 @@ module MJITHeader end def self.write(code, out) - FileUtils.mkdir_p(File.dirname(out)) - File.binwrite("#{out}.new", code) + # create with strict permission, then will install proper + # permmsion + FileUtils.mkdir_p(File.dirname(out), mode: 0700) + File.binwrite("#{out}.new", code, perm: 0600) FileUtils.mv("#{out}.new", out) end