[#25035] 拡張ライブラリへの共有ライブラリのPATHの埋め込み — Takahiro Kambe <taca@...>

こんにちは。

16 messages 2004/12/03
[#25070] Re: 拡張ライブラリへの共有ライブラリのPATHの埋め込み — nobu@... 2004/12/06

なかだです。

[#25071] Re: 拡張ライブラリへの共有ライブラリのPATHの埋め込み — Takahiro Kambe <taca@...> 2004/12/06

In message <200412060607.iB667giF007533@sharui.nakada.niregi.kanuma.tochigi.jp>

[#25089] Re: 拡張ライブラリへの共有ライブラリのPATHの埋め込み — nobu@... 2004/12/07

なかだです。

[#25090] Re: 拡張ライブラリへの共有ライブラリのPATHの埋め込み — Takahiro Kambe <taca@...> 2004/12/07

In message <200412070015.iB70FAiF012770@sharui.nakada.niregi.kanuma.tochigi.jp>

[#25093] Re: 拡張ライブラリへの共有ライブラリのPATHの埋め込み — akira yamada / やまだあきら <akira@...> 2004/12/07

2004-12-07 (火) の 12:27 +0900 に Takahiro Kambe さんは書きました:

[#25041] temporal locking already locked string on simultaneous write — Tanaka Akira <akr@...17n.org>

同じ文字列をほぼ同時に IO に書き込むと、temporal locking already

13 messages 2004/12/04
[#25042] Re: temporal locking already locked string on simultaneous write — Yukihiro Matsumoto <matz@...> 2004/12/04

まつもと ゆきひろです

[#25043] Re: temporal locking already locked string on simultaneous write — Tanaka Akira <akr@...17n.org> 2004/12/04

In article <1102133507.339625.10453.nullmailer@x31.priv.netlab.jp>,

[#25096] double free problem — "Akinori MUSHA" <knu@...>

 ご無沙汰しております。

15 messages 2004/12/07
[#25099] Re: double free problem — Yukihiro Matsumoto <matz@...> 2004/12/07

Hi,

[#25101] non-stdio buffering — Tanaka Akira <akr@...17n.org>

えぇと、今回 1.9 でなにが起きたのかを私が把握している範囲でまとめてお

18 messages 2004/12/07

[#25152] 1.8 reopen problem with duplex popen — Tanaka Akira <akr@...17n.org>

次のように、1.8 で双方向 popen な IO を reopen するとエラーになること

11 messages 2004/12/10

[#25158] core dump on NetBSD 2.0 — Tanaka Akira <akr@...17n.org>

NetBSD 2.0 で次のようにすると core を吐きます。

18 messages 2004/12/11
[#25159] Re: core dump on NetBSD 2.0 — Tanaka Akira <akr@...17n.org> 2004/12/11

In article <87hdmsivva.fsf@serein.a02.aist.go.jp>,

[#25163] Re: core dump on NetBSD 2.0 — Tanaka Akira <akr@...17n.org> 2004/12/12

In article <87ekhwiv7g.fsf@serein.a02.aist.go.jp>,

[#25165] Re: core dump on NetBSD 2.0 — nobu@... 2004/12/13

なかだです。

[#25167] Re: core dump on NetBSD 2.0 — Tanaka Akira <akr@...17n.org> 2004/12/13

In article <200412130040.iBD0e8Qh003275@sharui.nakada.niregi.kanuma.tochigi.jp>,

[#25193] 1.8.2 release schedule — Yukihiro Matsumoto <matz@...>

まつもと ゆきひろです

15 messages 2004/12/14

[#25299] Re: リリース準備 — Yukihiro Matsumoto <matz@...>

まつもと ゆきひろです

20 messages 2004/12/24
[#25301] Re: リリース準備 — TAKAHASHI Masayoshi <maki@...> 2004/12/24

高橋征義です。

[#25302] test_readline.rb blocks on BSD again — GOTOU Yuuzou <gotoyuzo@...>

In message <20041223175402.3116FC6718@lithium.ruby-lang.org>,

15 messages 2004/12/24
[#25314] Re: test_readline.rb blocks on BSD again — GOTOU Yuuzou <gotoyuzo@...> 2004/12/24

In message <20041224.131211.846943951.gotoyuzo@sawara.does.notwork.org>,

[#25315] Re: test_readline.rb blocks on BSD again — Yukihiro Matsumoto <matz@...> 2004/12/24

まつもと ゆきひろです

[#25317] Re: test_readline.rb blocks on BSD again — WATANABE Hirofumi <eban@...> 2004/12/25

わたなべです。

[ruby-dev:25131] Re: SecurityError in webrick/cgi

From: Minero Aoki <aamine@...>
Date: 2004-12-08 14:30:31 UTC
List: ruby-dev #25131
青木です。

情報が足りなかったので再度投げます。

CVS HEAD の ruby で、webrick/cgi を使った CGI アプリケーションを
$SAFE=1 で動かすと、以下のように webrick/cgi 内で落ちます。

./lib/webrick/cgi.rb:140:in `initialize': invalid CGI environment (WEBrick::CGI::CGIError)
        from ./lib/webrick/cgi.rb:43:in `new'
        from ./lib/webrick/cgi.rb:43:in `start'
        from hello.cgi:13
[Wed Dec  8 22:20:35 2004] [error] [client 127.0.0.1] Premature end of script headers: /home/aamine/public_html/bc/hello.cgi

CGI アプリケーションには sample/webrick/hello.cgi を
少し書きかえて使いました。内容は以下の通りです。

  #!/usr/bin/env ruby
  $LOAD_PATH.unshift './lib'
  require "webrick/cgi"

  class HelloCGI < WEBrick::CGI
    def do_GET(req, res)
      res["content-type"] = "text/plain"
      res.body = "Hello, world.\n"
    end
  end

  $SAFE = 1
  HelloCGI.new.start

また、webrick/cgi を手元にコピーして 157 行目の rescue を
消してみると次のようになりました。

./lib/webrick/cgi.rb:171:in `[]': Insecure operation - [] (SecurityError)
        from ./lib/webrick/cgi.rb:171:in `add_header'
        from ./lib/webrick/cgi.rb:165:in `setup_header'
        from ./lib/webrick/cgi.rb:163:in `each_key'
        from ./lib/webrick/cgi.rb:163:in `setup_header'
        from ./lib/webrick/cgi.rb:136:in `initialize'
        from ./lib/webrick/cgi.rb:43:in `new'
        from ./lib/webrick/cgi.rb:43:in `start'
        from hello.cgi:13
[Wed Dec  8 22:21:59 2004] [error] [client 127.0.0.1] Premature end of script headers: /home/aamine/public_html/bc/hello.cgi

じゃあ WEBrick::CGI#setup_header で untaint すればいいのかと思い
試してみると、今度は次のようなエラーになりました。

./lib/webrick/cgi.rb:164:in `untaint': can't modify frozen object (RuntimeError)
        from ./lib/webrick/cgi.rb:164:in `setup_header'
        from ./lib/webrick/cgi.rb:163:in `each_key'
        from ./lib/webrick/cgi.rb:163:in `setup_header'
        from ./lib/webrick/cgi.rb:136:in `initialize'
        from ./lib/webrick/cgi.rb:43:in `new'
        from ./lib/webrick/cgi.rb:43:in `start'
        from hello.cgi:13
[Wed Dec  8 22:22:56 2004] [error] [client 127.0.0.1] Premature end of script headers: /home/aamine/public_html/bc/hello.cgi

しかたがないので次のように変更したら、やっと通りました。

--- lib/webrick/cgi.rb.org      2004-12-08 22:16:27.000000000 +0900
+++ lib/webrick/cgi.rb  2004-12-08 22:17:39.000000000 +0900
@@ -161,6 +161,7 @@ module WEBrick
         add_header("CONTENT_TYPE", "Content-Type")
         add_header("CONTENT_LENGTH", "Content-length")
         @env.each_key{|name|
+          name = name.dup.untaint
           if /^HTTP_(.*)/ =~ name
             add_header(name, $1.gsub(/_/, "-"))
           end

-------------------------------------------------------------------
青木峰郎

In This Thread