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

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


Revision: 5151
          http://trac.macosforge.org/projects/ruby/changeset/5151
Author:   watson1978 at gmail.com
Date:     2011-01-10 04:06:35 -0800 (Mon, 10 Jan 2011)
Log Message:
-----------
Module#public (and some method) with untrusted will not throw a SecurityError.

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 }
}}}

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

Modified: MacRuby/trunk/vm_method.c
===================================================================
--- MacRuby/trunk/vm_method.c	2011-01-10 12:06:24 UTC (rev 5150)
+++ MacRuby/trunk/vm_method.c	2011-01-10 12:06:35 UTC (rev 5151)
@@ -421,7 +421,7 @@
 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");
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110110/ba37bcfc/attachment.html>


More information about the macruby-changes mailing list