Permalink
Browse files

Module#remove_method with untrusted will not throw a SecurityError.

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

T.untrust
$SAFE = 4

T.class_eval{ remove_method :foo }
}}}

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@5149 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
1 parent 93a9f53 commit 3e5975dc84260f044811cd49062796c6dcff2964 @Watson1978 Watson1978 committed Jan 10, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 vm_method.c
View
@@ -14,7 +14,7 @@ remove_method(VALUE klass, ID mid)
if (klass == rb_cObject) {
rb_secure(4);
}
- if (rb_safe_level() >= 4 && !OBJ_TAINTED(klass)) {
+ if (rb_safe_level() >= 4 && !OBJ_UNTRUSTED(klass)) {
rb_raise(rb_eSecurityError, "Insecure: can't remove method");
}
if (OBJ_FROZEN(klass)) {

0 comments on commit 3e5975d

Please sign in to comment.