зеркало из https://github.com/github/ruby.git
revert r60596 because it cause faulure on TestFile#test_realpath_taintedness
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
bfbf5b0b3e
Коммит
76d4fa8d15
2
file.c
2
file.c
|
@ -4086,7 +4086,7 @@ rb_check_realpath_internal(VALUE basedir, VALUE path, enum rb_realpath_mode mode
|
|||
}
|
||||
}
|
||||
|
||||
OBJ_INFECT(resolved, unresolved_path);
|
||||
OBJ_TAINT(resolved);
|
||||
RB_GC_GUARD(unresolved_path);
|
||||
RB_GC_GUARD(curdir);
|
||||
return resolved;
|
||||
|
|
|
@ -283,23 +283,6 @@ class TestFile < Test::Unit::TestCase
|
|||
}
|
||||
end
|
||||
|
||||
def test_realpath_taintedness
|
||||
Dir.mktmpdir('rubytest-realpath') {|tmpdir|
|
||||
realdir = File.realpath(tmpdir)
|
||||
assert_predicate(realdir, :tainted?)
|
||||
dir, base = File.split(realdir)
|
||||
assert_predicate(File.realpath(base, dir), :tainted?)
|
||||
base.untaint
|
||||
assert_predicate(File.realpath(base, dir), :tainted?)
|
||||
base.taint
|
||||
dir.untaint
|
||||
assert_predicate(File.realpath(base, dir), :tainted?)
|
||||
base.untaint
|
||||
assert_not_predicate(File.realpath(base, dir), :tainted?)
|
||||
assert_predicate(Dir.chdir(dir) {File.realpath(base)}, :tainted?)
|
||||
}
|
||||
end
|
||||
|
||||
def test_realdirpath
|
||||
Dir.mktmpdir('rubytest-realdirpath') {|tmpdir|
|
||||
realdir = File.realpath(tmpdir)
|
||||
|
|
Загрузка…
Ссылка в новой задаче