felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1720103 - /felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java
Date Tue, 15 Dec 2015 09:49:20 GMT
Author: gnodet
Date: Tue Dec 15 09:49:20 2015
New Revision: 1720103

URL: http://svn.apache.org/viewvc?rev=1720103&view=rev
Log:
[FELIX-4975] fileinstall's ConfigInstaller leaks it's permission checks to caller

Modified:
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java?rev=1720103&r1=1720102&r2=1720103&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java
Tue Dec 15 09:49:20 2015
@@ -20,6 +20,8 @@ package org.apache.felix.fileinstall.int
 
 import java.io.*;
 import java.net.URI;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.*;
 
 import org.apache.felix.cm.file.ConfigurationHandler;
@@ -86,7 +88,28 @@ public class ConfigInstaller implements
         deleteConfig(artifact);
     }
 
-    public void configurationEvent(ConfigurationEvent configurationEvent)
+    public void configurationEvent(final ConfigurationEvent configurationEvent)
+    {
+        if (System.getSecurityManager() != null)
+        {
+            AccessController.doPrivileged(
+                    new PrivilegedAction<Void>()
+                    {
+                        public Void run()
+                        {
+                            doConfigurationEvent(configurationEvent);
+                            return null;
+                        }
+                    }
+            );
+        }
+        else
+        {
+            doConfigurationEvent(configurationEvent);
+        }
+    }
+
+    public void doConfigurationEvent(ConfigurationEvent configurationEvent)
     {
         // Check if writing back configurations has been disabled.
         {



Mime
View raw message