Project

General

Profile

Actions

Feature #19244

closed

Windows: USERPROFILE should be preferred over HOMEPATH

Added by larskanis (Lars Kanis) over 1 year ago. Updated 5 months ago.

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

Description

Create a new local user on Windows called "testuser".
Then switch to the new user per runas:

C:\> runas /user:testuser cmd

Then in the new window:

C:\>ruby -e "p Dir.home"
"C:/WINDOWS/system32"

C:\>echo %HOMEDRIVE%
C:

C:\>echo %HOMEPATH%
\WINDOWS\system32

C:\>echo %USERPROFILE%
C:\Users\testuser

Dir.home should return the home directory of the user.
Instead it returns C:/WINDOWS/system32.

HOMEPATH is set to "\WINDOWS\system32" when running per "runas" session.
This directory is not writable by ordinary users, leading to errors with many ruby tools.
Also config files in the home directory are not recognized.

All versions of ruby until current master branch are affected.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0