lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cpoersc...@apache.org
Subject [lucene-solr] branch branch_8x updated: SOLR-15073: Fix ClassCastException in SystemInfoHandler.getSecurityInfo.
Date Fri, 22 Jan 2021 21:36:27 GMT
This is an automated email from the ASF dual-hosted git repository.

cpoerschke pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new 315f26f  SOLR-15073: Fix ClassCastException in SystemInfoHandler.getSecurityInfo.
315f26f is described below

commit 315f26fd70f9a2d254e7ef80fc317276497afe7b
Author: Christine Poerschke <cpoerschke@apache.org>
AuthorDate: Fri Jan 22 18:33:28 2021 +0000

    SOLR-15073: Fix ClassCastException in SystemInfoHandler.getSecurityInfo.
    
    Same fix as the #2210 PR commit earlier but this time not extending SystemInfoHandlerTest
and also not adding a static SystemInfoHandler.getSecurityInfo variant for test use.
---
 solr/CHANGES.txt                                                        | 2 ++
 solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index c4c48e5..60ba68c 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -170,6 +170,8 @@ Bug Fixes
 
 * SOLR-15070: Suggester requests made with SolrJ can now use XMLResponseParser (Jason Gerlowski)
 
+* SOLR-15073: Fix ClassCastException in SystemInfoHandler.getSecurityInfo. (Nikolay Ivanov,
Christine Poerschke)
+
 * SOLR-15071: Fix ArrayIndexOutOfBoundsException in contrib/ltr SolrFeatureScorer.
   (Florin Babes, Ovidiu Mihalcea, David Smiley, Christine Poerschke)
 
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java
index 9c4828c..0440e10 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java
@@ -341,7 +341,7 @@ public class SystemInfoHandler extends RequestHandlerBase
       // Mapped roles for this principal
       @SuppressWarnings("resource")
       AuthorizationPlugin auth = cc==null? null: cc.getAuthorizationPlugin();
-      if (auth != null) {
+      if (auth instanceof RuleBasedAuthorizationPluginBase) {
         RuleBasedAuthorizationPluginBase rbap = (RuleBasedAuthorizationPluginBase) auth;
         Set<String> roles = rbap.getUserRoles(req.getUserPrincipal());
         info.add("roles", roles);


Mime
View raw message