summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-05 02:25:46 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-05 02:25:46 (GMT)
commit002e0ca4280f757bdf30f20c5ed88220059af234 (patch)
treeddb481474f1e50dcf4283805820cb0e1e4905fc9 /tool
parent5164e2e43a95caae0e73d0be93785feece9ce59c (diff)
Create MJIT header with strict permission
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rw-r--r--tool/transform_mjit_header.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/tool/transform_mjit_header.rb b/tool/transform_mjit_header.rb
index 4784a47..91e4a97 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