uschindler commented on code in PR #1271:
URL: https://github.com/apache/solr/pull/1271#discussion_r1062567032
##########
solr/solrj/src/java/org/apache/solr/client/solrj/util/Constants.java:
##########
@@ -25,4 +25,15 @@ public class Constants {
public static final boolean JRE_IS_MINIMUM_JAVA11 = true;
// Future, enable if needed...
// public static final boolean JRE_IS_MINIMUM_JAVA17 =
Runtime.version().feature() >= 17;
+
+ public static final boolean IS_IBM_JAVA = isIBMJava();
+
+ private static boolean isIBMJava() {
+ try {
+ Class.forName("com.ibm.security.auth.module.Krb5LoginModule", false,
null);
+ return true;
+ } catch (ClassNotFoundException e) {
Review Comment:
See also Javadoc:
> If the parameter loader is null, the class is loaded through the bootstrap
class loader.
>
>
[SecurityException](https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/SecurityException.html)
- if a security manager is present, and the loader is null, and the caller's
class loader is not null, and the caller does not have the
[RuntimePermission](https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/RuntimePermission.html)("getClassLoader")
So to not get into security problems use the suggestion here:
> For example, in an instance method the expression:
> Class.forName("Foo")
> is equivalent to:
> Class.forName("Foo", true, this.getClass().getClassLoader())
so just replace by "false".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]