You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Continuing #4450 which was closed as “identical to MRI” but they are not exactly done the same way, since the original issue was closed I hope to have this discussion continued in a new issue, and apologise for the bother in advance.
Dir.tmpdir is implemented in JRuby 9.1.5.0 with:
def self.tmpdir
if $SAFE > 0
@@systmpdir.dup
else
tmp = nil
# Search a directory which isn't world-writable first. In JRuby,
# FileUtils.remove_entry_secure(dir) crashes when a dir is under
# a world-writable directory because it tries to open directory.
# Opening directory is not allowed in Java.
dirs = [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp', '.']
for dir in dirs
if dir and stat = File.stat(dir) and stat.directory? and stat.writable? and !stat.world_writable?
return File.expand_path(dir)
end
end
# Some OS sets the environment variables to '/tmp', which we may reject.
warn "Unable to find a non world-writable directory for #{__method__}. Consider setting ENV['TMPDIR'], ENV['TMP'] or ENV['TEMP'] to a non world-writable directory."
[ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp', '.'].each do |dir|
next if !dir
dir = File.expand_path(dir)
if stat = File.stat(dir) and stat.directory? and stat.writable? and
(!stat.world_writable? or stat.sticky?)
tmp = dir
break
end rescue nil
end
raise ArgumentError, "could not find a temporary directory" unless tmp
tmp
end
end
Dir.tmpdir is implemented in MRI 2.3 with:
def self.tmpdir
if $SAFE > 0
@@systmpdir.dup
else
tmp = nil
[ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp', '.'].each do |dir|
next if !dir
dir = File.expand_path(dir)
if stat = File.stat(dir) and stat.directory? and stat.writable? and
(!stat.world_writable? or stat.sticky?)
tmp = dir
break
end rescue nil
end
raise ArgumentError, "could not find a temporary directory" unless tmp
tmp
end
end
The text was updated successfully, but these errors were encountered:
you should have tried latest JRuby 9.1 ... the implementations are expected to be the same since 9.1.6.0 ee17203 (from #4184) - hopefully that does it for you - way too many issues around /tmp :)
Continuing #4450 which was closed as “identical to MRI” but they are not exactly done the same way, since the original issue was closed I hope to have this discussion continued in a new issue, and apologise for the bother in advance.
Dir.tmpdir is implemented in JRuby 9.1.5.0 with:
Dir.tmpdir is implemented in MRI 2.3 with:
The text was updated successfully, but these errors were encountered: