[#111712] [Ruby master Feature#19322] Support spawning "private" child processes — "kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core" <ruby-core@...>
SXNzdWUgIzE5MzIyIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGtqdHNhbmFrdHNpZGlzIChLSiBUc2Fu
14 messages
2023/01/07
[ruby-core:111607] [Ruby master Bug#19244] Windows: USERPROFILE should be preferred over HOMEPATH
From:
"larskanis (Lars Kanis) via ruby-core" <ruby-core@...>
Date:
2023-01-03 17:02:53 UTC
List:
ruby-core #111607
Issue #19244 has been updated by larskanis (Lars Kanis). The above patch was incomplete, so that the order of the environment variables was changed in `Dir.home`, but not the order in the startup phase, which sets the `HOME` environment variable. This is fixed in https://github.com/ruby/ruby/pull/7033 . In https://github.com/ruby/ruby/pull/7034 this kind of duplicated code is removed, so that only one code path is defining the order of evaluation. ---------------------------------------- Bug #19244: Windows: USERPROFILE should be preferred over HOMEPATH https://bugs.ruby-lang.org/issues/19244#change-100976 * Author: larskanis (Lars Kanis) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x64-mingw-ucrt] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- 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. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- [email protected] To unsubscribe send an email to [email protected] ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/