Project

General

Profile

Feature #12226

Dir.home with valid named user raises ArgumentError on Windows

Added by vais (Vais Salikhov) over 4 years ago. Updated over 4 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:74616]

Description

C:\>C:\Ruby\ruby-2.2.4-x64-mingw32\bin\ruby.exe -ve "p Dir.home; p Dir.home('Administrator')"
ruby 2.2.4p230 (2015-12-16 revision 53155) [x64-mingw32]
"C:/Users/Administrator"
-e:1:in `home': user Administrator doesn't exist (ArgumentError)
        from -e:1:in `<main>'

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

Windows seems not providing the way to know another user's home path without authentication.

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

  • Tracker changed from Bug to Feature
#3

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

  • Status changed from Open to Closed

Applied in changeset r54947.


file.c: home dir fall back

  • file.c (rb_home_dir_of): return the default home path if the user name is the current user name, on platforms where struct pwd is not supported. a temporary measure against [Bug #12226].

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

  • Status changed from Closed to Open

Also available in: Atom PDF