Permalink
Browse files

Module#public (and some method) with untrusted will not throw a Secur…

…ityError.

Test Script:
{{{
class T
  def foo ; end
end

module M
  def bar ; end
end

T.untrust
M.untrust
$SAFE = 4

T.class_eval{ public :foo }
T.class_eval{ protected :foo }
T.class_eval{ private :foo }

M.module_eval{ module_function :bar }
}}}

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@5151 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
Watson1978 committed Jan 10, 2011
1 parent 2a7e2e5 commit ed44bd984dcbff5644afebb69e5d5d0dca429cf4
Showing with 1 addition and 1 deletion.
  1. +1 −1 vm_method.c
View
@@ -421,7 +421,7 @@ rb_mod_alias_method(VALUE mod, SEL sel, VALUE newname, VALUE oldname)
static void
secure_visibility(VALUE self)
{
- if (rb_safe_level() >= 4 && !OBJ_TAINTED(self)) {
+ if (rb_safe_level() >= 4 && !OBJ_UNTRUSTED(self)) {
rb_raise(rb_eSecurityError,
"Insecure: can't change method visibility");
}

0 comments on commit ed44bd9

Please sign in to comment.