RFR: 8314094: java/lang/ProcessHandle/InfoTest.java fails on Windows when run as user with Administrator privileges

Arno Zeller azeller at openjdk.org
Thu Aug 31 06:59:04 UTC 2023


On Wed, 30 Aug 2023 15:58:37 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Yes, I think using System.getProperty("user.name") is brittle as well. If we'd use `com.sun.security.auth.module.NTSystem`, we would introduce the dependency to another module - `jdk.security.auth`. Not sure, whether this is a good option.
>
> The system environment has the domainname and the username.
> 
> String username = (System.getenv("USERDOMAIN") + "/" + System.getenv("USERNAME")).toLowerCase(Locale.ROOT);

The problem with the environment variables is, that jtreg only passes very few of them down to the testee process  -  USERDOMAIN and USERNAME are not part of these as far as I know.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15222#discussion_r1311176210


More information about the core-libs-dev mailing list