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.

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

Commit messages:
 - Fallback to $HOME, if defined, if the os supplied user_home is
 - Fallback to $HOME if the home directory is "/" or not available
 - 8280357: user.home = "?" when running with systemd DynamicUser=true

Changes: https://git.openjdk.java.net/jdk/pull/7534/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7534&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8280357
  Stats: 8 lines in 1 file changed: 6 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7534.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7534/head:pull/7534

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

Reply via email to