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

From: Felipe Contreras <redmine@...>
Date: 2010-10-14 10:30:01 UTC
List: ruby-core #32784
Issue #3942 has been updated by Felipe Contreras.


@Shyouhei Thanks, require_relative does seem to be what I want. However, I still believe this issue is valid.

@Marcus That's a good explanation, whoever, that example you are providing seems unrealistic: system('rm -rf /') can be run in foo.rb directly. If you provide a realistic example, you would see that the issue is with ".", not with "/tmp", which matches Python's usage (they don't include "."). Also, I wonder if in such realistic example $: can't be modified to achieve the desired bad behavior.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/3942

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

In This Thread