1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2008-04-15 17:40:46 +00:00
parent 73437c05f5
commit 6cdd421a9b
2 changed files with 9 additions and 0 deletions

View file

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

4
ruby.c
View file

@ -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;