[jboss-cvs] JBossAS SVN: r61363 - branches/Branch_4_2/server/src/main/org/jboss/ejb/plugins.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Mar 16 00:46:25 EDT 2007


Author: anil.saldhana at jboss.com
Date: 2007-03-16 00:46:25 -0400 (Fri, 16 Mar 2007)
New Revision: 61363

Modified:
   branches/Branch_4_2/server/src/main/org/jboss/ejb/plugins/StatefulSessionInstanceInterceptor.java
Log:
JBAS-3781:In the presence of caller RAI, do not push a null subject context

Modified: branches/Branch_4_2/server/src/main/org/jboss/ejb/plugins/StatefulSessionInstanceInterceptor.java
===================================================================
--- branches/Branch_4_2/server/src/main/org/jboss/ejb/plugins/StatefulSessionInstanceInterceptor.java	2007-03-16 03:42:48 UTC (rev 61362)
+++ branches/Branch_4_2/server/src/main/org/jboss/ejb/plugins/StatefulSessionInstanceInterceptor.java	2007-03-16 04:46:25 UTC (rev 61363)
@@ -212,6 +212,8 @@
       EnterpriseContext ctx = null;
       
       BeanLock lock = container.getLockManager().getLock(methodID);
+      //JBAS-3781
+      boolean callerRunAsIdentityPresent = SecurityActions.peekRunAsIdentity() != null;
       try
       {
          /* The security context must be established before the cache
@@ -225,7 +227,8 @@
          of the ejb spec requirement that runtime exceptions should invalidate
          the session.
           */
-         SecurityActions.pushSubjectContext(mi.getPrincipal(), mi.getCredential(), null);
+         if(!callerRunAsIdentityPresent)
+            SecurityActions.pushSubjectContext(mi.getPrincipal(), mi.getCredential(), null);
 
          lock.sync();
          try
@@ -389,7 +392,8 @@
       finally
       {
          container.getLockManager().removeLockRef(lock.getId());
-         SecurityActions.popSubjectContext();
+         if(!callerRunAsIdentityPresent)
+            SecurityActions.popSubjectContext();
          EnterpriseBeanPolicyContextHandler.setEnterpriseBean(null);
       }
    }




More information about the jboss-cvs-commits mailing list