[ruby-core:78303] [Ruby trunk Feature#12695] File.expand_path should resolve ~/ using /etc/passwd when HOME is not set
From:
matz@...
Date:
2016-11-25 06:41:10 UTC
List:
ruby-core #78303
Issue #12695 has been updated by Yukihiro Matsumoto.
Accepted.
Matz.
----------------------------------------
Feature #12695: File.expand_path should resolve ~/ using /etc/passwd when HOME is not set
https://bugs.ruby-lang.org/issues/12695#change-61665
* Author: M奪rten Svantesson
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
I would expect a call like File.expand_path('~/.ssh/known_hosts') to work even though HOME is not set.
A reason this is important to fix is that libraries (in my use case Net::SSH) do calls like File.expand_path('~/.ssh/known_hosts'), but this will often fail when the code is run in a unix service, since HOME often isn't set then.
I considered reporting this as a bug, but the current behaviour is actually documented.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>