From: Kazuhiro NISHIYAMA Date: 2008-04-22T20:21:10+09:00 Subject: [ruby-dev:34487] check_insecure_method in trunk/lib/drb/drb.rb 西山和広です。 1.9のlib/drb/drb.rbのcheck_insecure_methodは obj.private_methods.include?(msg_id.to_s)のように なっていて、private_methodsなどがSymbolの配列を 返すのでprivateメソッドとprotectedメソッドの チェックが出来ていません。 Index: lib/drb/drb.rb =================================================================== --- lib/drb/drb.rb (revision 16147) +++ lib/drb/drb.rb (working copy) @@ -1476,10 +1476,10 @@ raise(ArgumentError, "#{any_to_s(msg_id)} is not a symbol") unless Symbol == msg_id.class raise(SecurityError, "insecure method `#{msg_id}'") if insecure_method?(msg_id) - if obj.private_methods.include?(msg_id.to_s) + if obj.private_methods.include?(msg_id) desc = any_to_s(obj) raise NoMethodError, "private method `#{msg_id}' called for #{desc}" - elsif obj.protected_methods.include?(msg_id.to_s) + elsif obj.protected_methods.include?(msg_id) desc = any_to_s(obj) raise NoMethodError, "protected method `#{msg_id}' called for #{desc}" else -- |ZnZ(ゼット エヌ ゼット) |西山和広(Kazuhiro NISHIYAMA)