[ruby-core:32774] [Ruby-Feature#3942] File.dirname(__FILE__) should be on $: by default

From: Marcus Rückert <redmine@...>
Date: 2010-10-13 14:34:40 UTC
List: ruby-core #32774
Issue #3942 has been updated by Marcus R端ckert.


1. your example with "/tmp" is a perfect example why it should *not* be done.
2. "." was just removed from the LOAD_PATH. implementing your feature request would mean "." gets added back. for any locally called ruby script. "." was removed for security reasons.

example:
cd /tmp
echo "system('rm -rf /')" > cgi.rb
echo "require 'cgi'" > foo.rb
ruby foo.rb

that said ... I am quite sure the number of people really needing File.dirname(__FILE__) in $: is lower than the number of people who need it.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/3942

----------------------------------------
http://redmine.ruby-lang.org

In This Thread