aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1339639 - /aries/branches/blueprint-0.3.2-fixes/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/ReflectionUtils.java
Date Thu, 17 May 2012 15:21:42 GMT
Author: gnodet
Date: Thu May 17 15:21:42 2012
New Revision: 1339639

URL: http://svn.apache.org/viewvc?rev=1339639&view=rev
Log:
ARIES-568: Fix up Java 2 Security problem for field injection introduced in #1067234

Modified:
    aries/branches/blueprint-0.3.2-fixes/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/ReflectionUtils.java

Modified: aries/branches/blueprint-0.3.2-fixes/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/ReflectionUtils.java
URL: http://svn.apache.org/viewvc/aries/branches/blueprint-0.3.2-fixes/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/ReflectionUtils.java?rev=1339639&r1=1339638&r2=1339639&view=diff
==============================================================================
--- aries/branches/blueprint-0.3.2-fixes/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/ReflectionUtils.java
(original)
+++ aries/branches/blueprint-0.3.2-fixes/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/ReflectionUtils.java
Thu May 17 15:21:42 2012
@@ -414,19 +414,21 @@ public class ReflectionUtils {
         }
 
         protected void internalSet(final ExtendedBlueprintContainer container, final Object
instance, final Object value) throws Exception {
-            if (useContainersPermission(container)) {
-                try {
-                    AccessController.doPrivileged(new PrivilegedExceptionAction<Object>()
{
-                        public Object run() throws Exception {
-                            doInternalSet(container, instance, value);
-                            return null;
-                        }                        
-                    });
-                } catch (PrivilegedActionException pae) {
-                    throw pae.getException();
+            try {
+                Boolean wasSet = AccessController.doPrivileged(new PrivilegedExceptionAction<Boolean>()
{
+                    public Boolean run() throws Exception {
+                      if (useContainersPermission(container)) {
+                        doInternalSet(container, instance, value);
+                        return Boolean.TRUE;
+                      }
+                      return Boolean.FALSE;
+                    }                        
+                });
+                if(!!!wasSet) {
+                  doInternalSet(container, instance, value);
                 }
-            } else {
-                doInternalSet(container, instance, value);
+            } catch (PrivilegedActionException pae) {
+                throw pae.getException();
             }
         }
         



Mime
View raw message