You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by fp...@apache.org on 2022/09/26 06:37:54 UTC

[shiro] branch 1.10.x updated (fcc4e6b5 -> 536603f0)

This is an automated email from the ASF dual-hosted git repository.

fpapon pushed a change to branch 1.10.x
in repository https://gitbox.apache.org/repos/asf/shiro.git


    from fcc4e6b5 [BUILD] set version to 1.10.0-SNAPSHOT
     new 2765effd catch SessionException in getRunAsPrincipalsStack Fixes SHIRO-512
     new 536603f0 added comments

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/shiro/subject/support/DelegatingSubject.java   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)


[shiro] 01/02: catch SessionException in getRunAsPrincipalsStack Fixes SHIRO-512

Posted by fp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

fpapon pushed a commit to branch 1.10.x
in repository https://gitbox.apache.org/repos/asf/shiro.git

commit 2765effd1820be8ad78948779926eb31905af6f5
Author: lprimak <le...@flowlogix.com>
AuthorDate: Sun Sep 4 22:15:46 2022 -0700

    catch SessionException in getRunAsPrincipalsStack
    Fixes SHIRO-512
---
 .../java/org/apache/shiro/subject/support/DelegatingSubject.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java b/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java
index 406bec40..431c8464 100644
--- a/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java
+++ b/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java
@@ -470,7 +470,12 @@ public class DelegatingSubject implements Subject {
     private List<PrincipalCollection> getRunAsPrincipalsStack() {
         Session session = getSession(false);
         if (session != null) {
-            return (List<PrincipalCollection>) session.getAttribute(RUN_AS_PRINCIPALS_SESSION_KEY);
+            try {
+                return (List<PrincipalCollection>) session.getAttribute(RUN_AS_PRINCIPALS_SESSION_KEY);
+            } catch (SessionException se) {
+                log.debug("Encountered session exception trying to get 'runAs' principal stack.  This "
+                        + "can generally safely be ignored.", se);
+            }
         }
         return null;
     }


[shiro] 02/02: added comments

Posted by fp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

fpapon pushed a commit to branch 1.10.x
in repository https://gitbox.apache.org/repos/asf/shiro.git

commit 536603f0c0eb18c73f05270e7adcbc49021d76b2
Author: lprimak <le...@flowlogix.com>
AuthorDate: Mon Sep 5 08:52:52 2022 -0700

    added comments
---
 .../main/java/org/apache/shiro/subject/support/DelegatingSubject.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java b/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java
index 431c8464..e0326b91 100644
--- a/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java
+++ b/core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java
@@ -473,6 +473,10 @@ public class DelegatingSubject implements Subject {
             try {
                 return (List<PrincipalCollection>) session.getAttribute(RUN_AS_PRINCIPALS_SESSION_KEY);
             } catch (SessionException se) {
+                // There could be a rare race condition when a session is invalidated in another thread,
+                // this thread could throw this exception, so we catch it
+                // similar issue as in clearRunAsIdentitiesInternal()
+                // See https://issues.apache.org/jira/browse/SHIRO-512
                 log.debug("Encountered session exception trying to get 'runAs' principal stack.  This "
                         + "can generally safely be ignored.", se);
             }