[jboss-cvs] JBossAS SVN: r92286 - branches/Branch_5_x/server/src/main/org/jboss/jmx/connector/invoker.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Aug 12 18:17:03 EDT 2009


Author: anil.saldhana at jboss.com
Date: 2009-08-12 18:17:03 -0400 (Wed, 12 Aug 2009)
New Revision: 92286

Modified:
   branches/Branch_5_x/server/src/main/org/jboss/jmx/connector/invoker/InvokerAdaptorService.java
Log:
JBAS-6449: InvokerAdapterService needs to return the SecurityContext under which the call was made

Modified: branches/Branch_5_x/server/src/main/org/jboss/jmx/connector/invoker/InvokerAdaptorService.java
===================================================================
--- branches/Branch_5_x/server/src/main/org/jboss/jmx/connector/invoker/InvokerAdaptorService.java	2009-08-12 21:13:09 UTC (rev 92285)
+++ branches/Branch_5_x/server/src/main/org/jboss/jmx/connector/invoker/InvokerAdaptorService.java	2009-08-12 22:17:03 UTC (rev 92286)
@@ -217,6 +217,9 @@
          if (newCL != null && newCL != oldCL)
             SecurityActions.setContextClassLoader(newCL);
 
+         //JBAS-6449: Cache the incoming security context to be retained on exit
+         SecurityContext previousSecurityContext = SecurityActions.getSecurityContext();
+         
          try
          {
             // Set the method hash to Method mapping
@@ -277,8 +280,11 @@
          finally
          {
             // Restore the input security context
-            SecurityActions.popSubjectContext();  
-            SecurityActions.clearSecurityContext();
+            SecurityActions.popSubjectContext();
+            if(previousSecurityContext != null)
+               SecurityActions.setSecurityContext(previousSecurityContext);
+            else
+               SecurityActions.clearSecurityContext();
             // Restore the input class loader
             if (newCL != null && newCL != oldCL)
                SecurityActions.setContextClassLoader(oldCL);




More information about the jboss-cvs-commits mailing list