[jboss-cvs] JBossAS SVN: r112440 - projects/ejb3/branches/jboss-ejb3-core-1.3.7_JBPAPP-7444/src/main/java/org/jboss/ejb3/security.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Nov 7 16:48:26 EST 2011


Author: dehort
Date: 2011-11-07 16:48:26 -0500 (Mon, 07 Nov 2011)
New Revision: 112440

Modified:
   projects/ejb3/branches/jboss-ejb3-core-1.3.7_JBPAPP-7444/src/main/java/org/jboss/ejb3/security/RunAsSecurityInterceptorv2.java
Log:
Possible fix for the situation where the RunAs identity is not getting propagated beyond the first EJB3 call.
[JBPAPP-7444]


Modified: projects/ejb3/branches/jboss-ejb3-core-1.3.7_JBPAPP-7444/src/main/java/org/jboss/ejb3/security/RunAsSecurityInterceptorv2.java
===================================================================
--- projects/ejb3/branches/jboss-ejb3-core-1.3.7_JBPAPP-7444/src/main/java/org/jboss/ejb3/security/RunAsSecurityInterceptorv2.java	2011-11-07 21:23:55 UTC (rev 112439)
+++ projects/ejb3/branches/jboss-ejb3-core-1.3.7_JBPAPP-7444/src/main/java/org/jboss/ejb3/security/RunAsSecurityInterceptorv2.java	2011-11-07 21:48:26 UTC (rev 112440)
@@ -86,8 +86,19 @@
             SecurityActions.setSecurityContext(sc);
          }  
       }
-      if(sc != null)
-        sc.setOutgoingRunAs(runAsIdentity);
+
+      if(sc != null) 
+      {
+        if( runAsIdentity == null && SecurityActions.peekRunAs() != null )
+        {
+          // Preserve the RunAs identity if one already exists
+          sc.setOutgoingRunAs(SecurityActions.peekRunAs());
+        } 
+        else
+        {
+          sc.setOutgoingRunAs(runAsIdentity);
+        }
+      }
       
       try
       {
@@ -108,4 +119,4 @@
    { 
       return getClass().getName();
    }  
-}
\ No newline at end of file
+}



More information about the jboss-cvs-commits mailing list