diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | eval.c | 9 | ||||
-rw-r--r-- | lib/delegate.rb | 2 | ||||
-rw-r--r-- | ruby.c | 17 |
4 files changed, 18 insertions, 20 deletions
@@ -1,3 +1,9 @@ +Fri Mar 27 13:49:27 1998 Yukihiro Matsumoto <matz@netlab.co.jp> + + * ruby.c (ruby_prog_init): load-path order changed. Paths in + the RUBYLIB environment variable comes first in non-tainted + mode. + Thu Mar 26 11:51:09 1998 Yukihiro Matsumoto <matz@netlab.co.jp> * eval.c (rb_call): new feature: `protected' methods. @@ -17,9 +23,9 @@ Wed Mar 25 08:12:07 1998 Yukihiro Matsumoto <matz@netlab.co.jp> float value. * eval.c (f_eval): optional third and fourth argument to specify - file name and line number. + file-name and line-number. - * eval.c (eval): filename and linenumber set properly. + * eval.c (eval): file-name and line-number set properly. * parse.y (assign_in_cond): literal assignment is now warning, not compile error. @@ -4163,14 +4163,6 @@ top_public(argc, argv) } static VALUE -top_protected(argc, argv) - int argc; - VALUE *argv; -{ - return mod_protected(argc, argv, cObject); -} - -static VALUE top_private(argc, argv) int argc; VALUE *argv; @@ -4436,7 +4428,6 @@ Init_eval() rb_define_singleton_method(TopSelf, "include", top_include, -1); rb_define_singleton_method(TopSelf, "public", top_public, -1); - rb_define_singleton_method(TopSelf, "protected", top_protected, -1); rb_define_singleton_method(TopSelf, "private", top_private, -1); rb_define_method(mKernel, "extend", obj_extend, -1); diff --git a/lib/delegate.rb b/lib/delegate.rb index 90d1d1abb0..30b1a32c12 100644 --- a/lib/delegate.rb +++ b/lib/delegate.rb @@ -20,7 +20,7 @@ class Delegator end for method in obj.methods next if preserved.include? method - eval "def self.#{method}(*args); __getobj__.__send__(:#{method}, *args){|x|yield}; end" + eval "def self.#{method}(*args,&block); __getobj__.__send__(:#{method}, *args,&block); end" end end @@ -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); |