From 36bd09dead31636e71ab9d74edff130cbd5124a4 Mon Sep 17 00:00:00 2001 From: Weijun Wang Date: Sat, 7 Dec 2019 09:40:28 +0800 Subject: [PATCH] 8233222: Clarify system property usage in KerberosPrincipal instantiation Reviewed-by: mullan --- .../auth/kerberos/KerberosPrincipal.java | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosPrincipal.java b/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosPrincipal.java index d52421ca8f..69bbcaf16d 100644 --- a/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosPrincipal.java +++ b/src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosPrincipal.java @@ -106,10 +106,19 @@ public final class KerberosPrincipal * *

If the input name does not contain a realm, the default realm * is used. The default realm can be specified either in a Kerberos - * configuration file or via the java.security.krb5.realm + * configuration file or via the {@systemproperty java.security.krb5.realm} * system property. For more information, see the * {@extLink security_guide_jgss_tutorial Kerberos Requirements}. - * Additionally, if a security manager is + * + *

Note that when this class or any other Kerberos-related class is + * initially loaded and initialized, it may read and cache the default + * realm from the Kerberos configuration file or via the + * java.security.krb5.realm system property (the value will be empty if + * no default realm is specified), such that any subsequent calls to set + * or change the default realm by setting the java.security.krb5.realm + * system property may be ignored. + * + *

Additionally, if a security manager is * installed, a {@link ServicePermission} must be granted and the service * principal of the permission must minimally be inside the * {@code KerberosPrincipal}'s realm. For example, if the result of @@ -146,10 +155,19 @@ public final class KerberosPrincipal * *

If the input name does not contain a realm, the default realm * is used. The default realm can be specified either in a Kerberos - * configuration file or via the java.security.krb5.realm + * configuration file or via the {@systemproperty java.security.krb5.realm} * system property. For more information, see the * {@extLink security_guide_jgss_tutorial Kerberos Requirements}. - * Additionally, if a security manager is + * + *

Note that when this class or any other Kerberos-related class is + * initially loaded and initialized, it may read and cache the default + * realm from the Kerberos configuration file or via the + * java.security.krb5.realm system property (the value will be empty if + * no default realm is specified), such that any subsequent calls to set + * or change the default realm by setting the java.security.krb5.realm + * system property may be ignored. + * + *

Additionally, if a security manager is * installed, a {@link ServicePermission} must be granted and the service * principal of the permission must minimally be inside the * {@code KerberosPrincipal}'s realm. For example, if the result of