RFR: 8280357: user.home = "?" when running with systemd DynamicUser=true

Roger Riggs rriggs at openjdk.java.net
Fri Feb 18 16:18:49 UTC 2022


On Fri, 18 Feb 2022 15:29:34 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> In some Linux configurations, the Linux home directory provided by getpwent is not usable.
> The value of the system property `user.home` should fallback to the value of $HOME 
> if getpwent.user_home is null or less that 2 characters long. "/" is not a valid home directory name.
> 
> If $HOME is undefined or empty, the value of the getpwent.user_home is retained.
> 
> There are more details in the Jira issue: https://bugs.openjdk.java.net/browse/JDK-8280357
> 
> The fix has been tested manually on Ubuntu 20.0.4 using the suggested systemd command line and variations.

I'm uncertain whether the fallback should only be done on Linux to cover the `systemd` case and Docker.
The need for a fallback seems less applicable on macOs, but since $HOME is usually set to the same value, may be harmless.

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

PR: https://git.openjdk.java.net/jdk/pull/7534


More information about the core-libs-dev mailing list