Bug #15803 ยป realpath-taint.patch
file.c | ||
---|---|---|
}
|
||
}
|
||
OBJ_INFECT(resolved, unresolved_path);
|
||
rb_obj_taint(resolved);
|
||
RB_GC_GUARD(unresolved_path);
|
||
RB_GC_GUARD(curdir);
|
||
return resolved;
|
test/ruby/test_file.rb | ||
---|---|---|
assert_predicate(File.realpath(base, dir), :tainted?)
|
||
base.untaint
|
||
dir.untaint
|
||
assert_not_predicate(File.realpath(base, dir), :tainted?)
|
||
assert_predicate(File.realpath(base, dir), :tainted?)
|
||
assert_predicate(Dir.chdir(dir) {File.realpath(base)}, :tainted?)
|
||
}
|
||
end
|