1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Create MJIT header with strict permission

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-11-05 02:25:46 +00:00
parent 5164e2e43a
commit 002e0ca428

View file

@ -148,8 +148,10 @@ module MJITHeader
end end
def self.write(code, out) def self.write(code, out)
FileUtils.mkdir_p(File.dirname(out)) # create with strict permission, then will install proper
File.binwrite("#{out}.new", code) # permmsion
FileUtils.mkdir_p(File.dirname(out), mode: 0700)
File.binwrite("#{out}.new", code, perm: 0600)
FileUtils.mv("#{out}.new", out) FileUtils.mv("#{out}.new", out)
end end