aboutsummaryrefslogtreecommitdiffstats
path: root/test/webrick/test_cgi.rb
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-18 13:33:24 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-18 13:33:24 +0000
commit8ee3267d26b4f87a9797573caa3dafb28e6945ee (patch)
treeab207c998e2a68cf76acf734851bc00aa14d7d46 /test/webrick/test_cgi.rb
parenta0e236f6065e5dfd68ac8a45ad1ca690042d47b9 (diff)
downloadruby-8ee3267d26b4f87a9797573caa3dafb28e6945ee.tar.gz
* lib/webrick/httpservlet/filehandler.rb: should normalize path
name in path_info to prevent script disclosure vulnerability on DOSISH filesystems. (fix: CVE-2008-1891) Note: NTFS/FAT filesystem should not be published by the platforms other than Windows. Pathname interpretation (including short filename) is less than perfect. * lib/webrick/httpservlet/abstract.rb (WEBrick::HTTPServlet::AbstracServlet#redirect_to_directory_uri): should escape the value of Location: header. * lib/webrick/httpservlet/cgi_runner.rb: accept interpreter command line arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/webrick/test_cgi.rb')
-rw-r--r--test/webrick/test_cgi.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/test/webrick/test_cgi.rb b/test/webrick/test_cgi.rb
index 7d883af3b5..c5dbc0bf96 100644
--- a/test/webrick/test_cgi.rb
+++ b/test/webrick/test_cgi.rb
@@ -1,20 +1,13 @@
require "webrick"
require File.join(File.dirname(__FILE__), "utils.rb")
require "test/unit"
-begin
- loadpath = $:.dup
- $:.replace($: | [File.expand_path("../ruby", File.dirname(__FILE__))])
- require 'envutil'
-ensure
- $:.replace(loadpath)
-end
class TestWEBrickCGI < Test::Unit::TestCase
def test_cgi
accepted = started = stopped = 0
requested0 = requested1 = 0
config = {
- :CGIInterpreter => EnvUtil.rubybin,
+ :CGIInterpreter => TestWEBrick::RubyBin,
:DocumentRoot => File.dirname(__FILE__),
:DirectoryIndex => ["webrick.cgi"],
:RequestHandler => Proc.new{|req, res|