summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-27 06:09:18 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-27 06:09:18 +0000
commite933a2791971a5667c52c9f3042aa38179722db2 (patch)
treec077006339525a622df69010013ed2fd4c2e977f /ruby.c
parentc88c96361d4c4e30db4e4078d744cd0b16ac4dcf (diff)
$:, remove top_protected
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/ruby.c b/ruby.c
index c05154357b..6983791336 100644
--- a/ruby.c
+++ b/ruby.c
@@ -636,6 +636,8 @@ forbid_setid(s)
Fatal("No %s allowed while running setuid", s);
if (egid != gid)
Fatal("No %s allowed while running setgid", s);
+ if (rb_safe_level() > 0)
+ Fatal("No %s allowed in tainted mode", s);
}
#if defined(_WIN32) || defined(DJGPP)
@@ -689,22 +691,21 @@ ruby_prog_init()
addpath(".");
}
+ addpath(RUBY_LIB);
#if defined(_WIN32) || defined(DJGPP)
addpath(ruby_libpath());
#endif
- if (rb_safe_level() == 0) {
- addpath(getenv("RUBYLIB"));
- }
-
+#ifdef RUBY_ARCHLIB
+ addpath(RUBY_ARCHLIB);
+#endif
#ifdef RUBY_THIN_ARCHLIB
addpath(RUBY_THIN_ARCHLIB);
#endif
-#ifdef RUBY_ARCHLIB
- addpath(RUBY_ARCHLIB);
-#endif
- addpath(RUBY_LIB);
+ if (rb_safe_level() == 0) {
+ addpath(getenv("RUBYLIB"));
+ }
rb_define_hooked_variable("$0", &rb_progname, 0, set_arg0);