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

Alan Bateman alanb at openjdk.java.net
Fri Feb 18 15:54:47 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.

There is an argument that the JDK should read $HOME first but changing it after 20+ years could be risky, probably difficult to get a list of configurations/environments where the two might yield different locations. So I think the approach is reasonable. Even if "/" were a configured as the home directory in the user entry then $HOME would need to agree so that I think the <2 check is okay too.

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

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


More information about the core-libs-dev mailing list