Skip to content

Commit

Permalink
Module#remove_method with untrusted will not throw a SecurityError.
Browse files Browse the repository at this point in the history
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
Watson1978 committed Jan 10, 2011
1 parent 93a9f53 commit 3e5975d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vm_method.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 3e5975d

Please sign in to comment.