diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-11-25 03:31:19 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-11-25 03:31:19 +0000 |
commit | ce8859c5563493a94f57d3b630e7b9c1d3cd656f (patch) | |
tree | eefe3446c88ef90ff4d3578ae925b4e69d762822 /variable.c | |
parent | 75ff8fdb16fa0a733512e61350c9844ea530ad35 (diff) |
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1dev@344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/variable.c b/variable.c index 14b5cf4390..85d6eafdaa 100644 --- a/variable.c +++ b/variable.c @@ -615,9 +615,8 @@ rb_gvar_set(entry, val) { struct trace_data trace; - if (rb_safe_level() >= 4) { - rb_raise(rb_eSecurityError, "cannot change global variable value"); - } + if (rb_safe_level() >= 4) + rb_raise(rb_eSecurityError, "Insecure: can't change global variable value"); (*entry->setter)(val, entry->id, entry->data, entry); if (entry->trace && !entry->block_trace) { @@ -726,6 +725,8 @@ rb_ivar_set(obj, id, val) case T_OBJECT: case T_CLASS: case T_MODULE: + if (rb_safe_level() >= 4 && !FL_TEST(obj, FL_TAINT)) + rb_raise(rb_eSecurityError, "Insecure: can't modify instance variable"); if (!ROBJECT(obj)->iv_tbl) ROBJECT(obj)->iv_tbl = st_init_numtable(); st_insert(ROBJECT(obj)->iv_tbl, id, val); break; @@ -1016,6 +1017,8 @@ rb_const_set(klass, id, val) ID id; VALUE val; { + if (rb_safe_level() >= 4 && !FL_TEST(klass, FL_TAINT)) + rb_raise(rb_eSecurityError, "Insecure: can't set constant"); if (!RCLASS(klass)->iv_tbl) { RCLASS(klass)->iv_tbl = st_init_numtable(); } |