File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 36
36
end
37
37
38
38
def tmp ( name , uniquify = true )
39
- mkdir_p SPEC_TEMP_DIR unless Dir . exist? SPEC_TEMP_DIR
39
+ if Dir . exist? SPEC_TEMP_DIR
40
+ stat = File . stat ( SPEC_TEMP_DIR )
41
+ if stat . world_writable? and !stat . sticky?
42
+ raise ArgumentError , "SPEC_TEMP_DIR (#{ SPEC_TEMP_DIR } ) is world writable but not sticky"
43
+ end
44
+ else
45
+ platform_is_not :windows do
46
+ umask = File . umask
47
+ if ( umask & 0002 ) == 0 # o+w
48
+ raise ArgumentError , "File.umask #=> #{ umask . to_s ( 8 ) } (world-writable)"
49
+ end
50
+ end
51
+ mkdir_p SPEC_TEMP_DIR
52
+ end
40
53
41
54
if uniquify and !name . empty?
42
55
slash = name . rindex "/"
Original file line number Diff line number Diff line change @@ -42,6 +42,6 @@ def aggregate_results(files)
42
42
end
43
43
44
44
def print_exception ( exc , count )
45
- print "\n #{ count } )\n #{ exc } \n "
45
+ @err . print "\n #{ count } )\n #{ exc } \n "
46
46
end
47
47
end
You can’t perform that action at this time.
0 commit comments