'SPEC_TEMP_DIR` should not be world-writable
`SPEC_TEMP_DIR` is not present until `tmp()` method is called on parallel run. In this case `tmp()` is called with `File.umask = 0`. This patch makes `SPEC_TEMP_DIR` before `File.umask = 0`. To solve the issue essentially, I think `SPEC_TEMP_DIR` should be prepared at the beginning of parallel process.
This commit is contained in:
parent
206465e84d
commit
39c9d99f6c
@ -71,14 +71,18 @@ module FindDirSpecs
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.create_mock_dirs
|
def self.create_mock_dirs
|
||||||
|
tmp('') # make sure there is an tmpdir
|
||||||
umask = File.umask 0
|
umask = File.umask 0
|
||||||
|
begin
|
||||||
mock_dir_files.each do |name|
|
mock_dir_files.each do |name|
|
||||||
file = File.join mock_dir, name
|
file = File.join mock_dir, name
|
||||||
mkdir_p File.dirname(file)
|
mkdir_p File.dirname(file)
|
||||||
touch file
|
touch file
|
||||||
end
|
end
|
||||||
|
ensure
|
||||||
File.umask umask
|
File.umask umask
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def self.delete_mock_dirs
|
def self.delete_mock_dirs
|
||||||
rm_r mock_dir
|
rm_r mock_dir
|
||||||
|
Loading…
x
Reference in New Issue
Block a user