An example case for the UnixSystem.java failure to retrieve uid, gid and groups if the user has no username
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UnixSystemNameless { | |
public static void main(String[] args) { | |
final var unixSystem = new com.sun.security.auth.module.UnixSystem(); | |
System.out.printf("username: %s%n", unixSystem.getUsername()); | |
System.out.printf("uid: %d%n", unixSystem.getUid()); | |
System.out.printf("gid: %d%n", unixSystem.getGid()); | |
System.out.printf("groups: %s%n", java.util.Arrays.toString(unixSystem.getGroups())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment