felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject svn commit: r638952 - /felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryImpl.java
Date Wed, 19 Mar 2008 17:44:19 GMT
Author: pauls
Date: Wed Mar 19 10:44:15 2008
New Revision: 638952

URL: http://svn.apache.org/viewvc?rev=638952&view=rev
Log:
Read repository information in a doPriv to make security easier.

Modified:
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryImpl.java

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryImpl.java?rev=638952&r1=638951&r2=638952&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryImpl.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/RepositoryImpl.java
Wed Mar 19 10:44:15 2008
@@ -26,6 +26,7 @@
 import java.util.Arrays;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
+import java.security.*;
 
 import org.apache.felix.bundlerepository.metadataparser.XmlCommonHandler;
 import org.apache.felix.bundlerepository.metadataparser.kxmlsax.KXml2SAXParser;
@@ -45,7 +46,21 @@
     public RepositoryImpl(URL url) throws Exception
     {
         m_url = url;
-        parseRepositoryFile(m_hopCount);
+        try
+        {
+            AccessController.doPrivileged(new PrivilegedExceptionAction()
+            {
+                public Object run() throws Exception
+                {
+                    parseRepositoryFile(m_hopCount);
+                    return null;
+                }
+            });
+        } 
+        catch (PrivilegedActionException ex) 
+        {
+            throw (Exception) ex.getCause();
+        }
     }
 
     public URL getURL()



Mime
View raw message