[jboss-cvs] JBossAS SVN: r112599 - projects/ejb3/branches/jboss-ejb3-core-1.3.8_JBPAPP-7897/src/main/java/org/jboss/ejb3/security.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jan 31 15:44:19 EST 2012


Author: dehort
Date: 2012-01-31 15:44:19 -0500 (Tue, 31 Jan 2012)
New Revision: 112599

Modified:
   projects/ejb3/branches/jboss-ejb3-core-1.3.8_JBPAPP-7897/src/main/java/org/jboss/ejb3/security/RunAsSecurityInterceptorv2.java
Log:
Fixing a run-as identity propagation bug
[JBPAPP-7897]


Modified: projects/ejb3/branches/jboss-ejb3-core-1.3.8_JBPAPP-7897/src/main/java/org/jboss/ejb3/security/RunAsSecurityInterceptorv2.java
===================================================================
--- projects/ejb3/branches/jboss-ejb3-core-1.3.8_JBPAPP-7897/src/main/java/org/jboss/ejb3/security/RunAsSecurityInterceptorv2.java	2012-01-31 20:40:50 UTC (rev 112598)
+++ projects/ejb3/branches/jboss-ejb3-core-1.3.8_JBPAPP-7897/src/main/java/org/jboss/ejb3/security/RunAsSecurityInterceptorv2.java	2012-01-31 20:44:19 UTC (rev 112599)
@@ -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