diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-13 07:25:05 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-13 07:25:05 +0000 |
commit | bd380f25fd23a0e7b31f72a7cc1e32fc9f522992 (patch) | |
tree | 5d6a14de43873b9ddaec533051b942cf89c201ce /class.c | |
parent | a8821182f6f47f451afc330c9d48c4d85825c0b3 (diff) | |
download | ruby-bd380f25fd23a0e7b31f72a7cc1e32fc9f522992.tar.gz ruby-bd380f25fd23a0e7b31f72a7cc1e32fc9f522992.tar.xz ruby-bd380f25fd23a0e7b31f72a7cc1e32fc9f522992.zip |
* object.c (rb_obj_untrusted): new method Object#untrusted?.
(rb_obj_untrust): new method Object#untrust.
(rb_obj_trust): new method Object#trust.
* array.c, debug.c, time.c, include/ruby/ruby.h, re.c, variable.c,
string.c, io.c, dir.c, vm_method.c, struct.c, class.c, hash.c,
ruby.c, marshal.c: fixes for Object#untrusted?.
* test/ruby/test_module.rb, test/ruby/test_array.rb,
test/ruby/test_object.rb, test/ruby/test_string.rb,
test/ruby/test_marshal.rb, test/ruby/test_hash.rb: added tests for
Object#untrusted?.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -383,7 +383,7 @@ rb_include_module(VALUE klass, VALUE module) int changed = 0; rb_frozen_class_p(klass); - if (!OBJ_TAINTED(klass)) { + if (!OBJ_UNTRUSTED(klass)) { rb_secure(4); } @@ -833,6 +833,12 @@ rb_singleton_class(VALUE obj) else { FL_UNSET(klass, FL_TAINT); } + if (OBJ_UNTRUSTED(obj)) { + OBJ_UNTRUST(klass); + } + else { + FL_UNSET(klass, FL_UNTRUSTED); + } if (OBJ_FROZEN(obj)) OBJ_FREEZE(klass); ALLOW_INTS; |