uschindler commented on code in PR #1271:
URL: https://github.com/apache/solr/pull/1271#discussion_r1062559127


##########
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:
   this works, but you really should also catch SecurityException, as this 
could happen with SecurityManager as enabled in SOlr by default.
   
   Also to prevent a security Exception the last parameter should be 
`Constants.class.getClassLoader()` (this is what the default forName is doing). 
Sending null will use system classloader and that one is restricted by security 
manager.



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to