[macruby-changes] [5149] MacRuby/trunk/vm_method.c

source_changes at macosforge.org source_changes at macosforge.org
Mon Jan 10 04:06:26 PST 2011


Revision: 5149
          http://trac.macosforge.org/projects/ruby/changeset/5149
Author:   watson1978 at gmail.com
Date:     2011-01-10 04:06:17 -0800 (Mon, 10 Jan 2011)
Log Message:
-----------
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 }
}}}

Modified Paths:
--------------
    MacRuby/trunk/vm_method.c

Modified: MacRuby/trunk/vm_method.c
===================================================================
--- MacRuby/trunk/vm_method.c	2011-01-10 09:09:48 UTC (rev 5148)
+++ MacRuby/trunk/vm_method.c	2011-01-10 12:06:17 UTC (rev 5149)
@@ -14,7 +14,7 @@
     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)) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110110/9d37fb3a/attachment.html>


More information about the macruby-changes mailing list