summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-15 17:40:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-15 17:40:46 +0000
commit6cdd421a9b5445512ab554155362d0c979a2a556 (patch)
tree93bb4fa214a2c0acd9f1b1d32d786f0f16a7af7f
parent73437c05f57aec9dd1d2438ed8e8962f28415505 (diff)
* ruby.c (process_options): preludes and parser need to run in safe
level 0. [ruby-dev:34407] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ruby.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index fdc16731f1..80bfba98ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Apr 16 02:40:44 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ruby.c (process_options): preludes and parser need to run in safe
+ level 0. [ruby-dev:34407]
+
Wed Apr 16 02:26:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (process_options): dln_find_file returns the pointer to a
diff --git a/ruby.c b/ruby.c
index e555191e65..5fa5092557 100644
--- a/ruby.c
+++ b/ruby.c
@@ -951,6 +951,7 @@ process_options(VALUE arg)
rb_encoding *enc;
const char *s;
int i = proc_options(argc, argv, opt);
+ int safe;
argc -= i;
argv += i;
@@ -1052,6 +1053,8 @@ process_options(VALUE arg)
process_sflag(opt);
ruby_init_loadpath();
+ safe = rb_safe_level();
+ rb_set_safe_level_force(0);
ruby_init_gems(!(opt->disable & DISABLE_BIT(gems)));
parser = rb_parser_new();
if (opt->yydebug) rb_parser_set_yydebug(parser, Qtrue);
@@ -1088,6 +1091,7 @@ process_options(VALUE arg)
}
tree = load_file(parser, opt->script, 1, opt);
}
+ rb_set_safe_level_force(safe);
if (!tree) return Qfalse;