Project

General

Profile

Actions

Feature #12695

closed

File.expand_path should resolve ~/ using /etc/passwd when HOME is not set

Added by fursten (Mårten Svantesson) about 8 years ago. Updated over 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:77019]

Description

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.


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #16787: [patch] allow Dir.home to work for non-login procs when $HOME not setClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0