summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/vm_method.c b/vm_method.c
index 35e1d6f45b..70fda7bf8b 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -234,10 +234,6 @@ rb_method_entry_make(VALUE klass, ID mid, rb_method_type_t type,
if (NIL_P(klass)) {
klass = rb_cObject;
}
- if (rb_safe_level() >= 4 &&
- (klass == rb_cObject || !OBJ_UNTRUSTED(klass))) {
- rb_raise(rb_eSecurityError, "Insecure: can't define method");
- }
if (!FL_TEST(klass, FL_SINGLETON) &&
type != VM_METHOD_TYPE_NOTIMPLEMENTED &&
type != VM_METHOD_TYPE_ZSUPER &&
@@ -657,10 +653,6 @@ remove_method(VALUE klass, ID mid)
klass = RCLASS_ORIGIN(klass);
if (klass == rb_cObject) {
- rb_secure(4);
- }
- if (rb_safe_level() >= 4 && !OBJ_UNTRUSTED(klass)) {
- rb_raise(rb_eSecurityError, "Insecure: can't remove method");
}
rb_check_frozen(klass);
if (mid == object_id || mid == id__send__ || mid == idInitialize) {
@@ -744,7 +736,6 @@ rb_export_method(VALUE klass, ID name, rb_method_flag_t noex)
VALUE defined_class;
if (klass == rb_cObject) {
- rb_secure(4);
}
me = search_method(klass, name, &defined_class);
@@ -847,10 +838,6 @@ rb_undef(VALUE klass, ID id)
rb_raise(rb_eTypeError, "no class to undef method");
}
if (rb_vm_cbase() == rb_cObject && klass == rb_cObject) {
- rb_secure(4);
- }
- if (rb_safe_level() >= 4 && !OBJ_UNTRUSTED(klass)) {
- rb_raise(rb_eSecurityError, "Insecure: can't undef `%s'", rb_id2name(id));
}
rb_frozen_class_p(klass);
if (id == object_id || id == id__send__ || id == idInitialize) {
@@ -1201,7 +1188,6 @@ rb_alias(VALUE klass, ID name, ID def)
rb_frozen_class_p(klass);
if (klass == rb_cObject) {
- rb_secure(4);
}
again:
@@ -1259,19 +1245,9 @@ rb_mod_alias_method(VALUE mod, VALUE newname, VALUE oldname)
}
static void
-secure_visibility(VALUE self)
-{
- if (rb_safe_level() >= 4 && !OBJ_UNTRUSTED(self)) {
- rb_raise(rb_eSecurityError,
- "Insecure: can't change method visibility");
- }
-}
-
-static void
set_method_visibility(VALUE self, int argc, VALUE *argv, rb_method_flag_t ex)
{
int i;
- secure_visibility(self);
if (argc == 0) {
rb_warning("%"PRIsVALUE" with no argument is just ignored",
@@ -1293,7 +1269,6 @@ set_method_visibility(VALUE self, int argc, VALUE *argv, rb_method_flag_t ex)
static VALUE
set_visibility(int argc, VALUE *argv, VALUE module, rb_method_flag_t ex)
{
- secure_visibility(module);
if (argc == 0) {
SCOPE_SET(ex);
}
@@ -1495,7 +1470,6 @@ rb_mod_modfunc(int argc, VALUE *argv, VALUE module)
rb_raise(rb_eTypeError, "module_function must be called for modules");
}
- secure_visibility(module);
if (argc == 0) {
SCOPE_SET(NOEX_MODFUNC);
return module;