summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-08 07:10:38 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-08 07:10:38 +0000
commit0e98ca3fe090d5593fb1e552723da0b48784b0a2 (patch)
tree955e671a4900baec8f68290207252f37d19d9a3d /lib
parent795ad7421b5624bfc77c1d86d5764bdd882bd4d4 (diff)
downloadruby-0e98ca3fe090d5593fb1e552723da0b48784b0a2.tar.gz
ruby-0e98ca3fe090d5593fb1e552723da0b48784b0a2.tar.xz
ruby-0e98ca3fe090d5593fb1e552723da0b48784b0a2.zip
matz
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/tempfile.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index 10f05a3b2..ab97f457a 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -29,6 +29,9 @@ class Tempfile < SimpleDelegator
end
def initialize(basename, tmpdir=ENV['TMPDIR']||ENV['TMP']||ENV['TEMP']||'/tmp')
+ if $SAFE > 0 and tmpdir.tainted?
+ tmpdir = '/tmp'
+ end
umask = File.umask(0177)
begin
n = 0