felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject svn commit: r498683 - /incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
Date Mon, 22 Jan 2007 16:35:58 GMT
Author: pauls
Date: Mon Jan 22 08:35:58 2007
New Revision: 498683

URL: http://svn.apache.org/viewvc?view=rev&rev=498683
Log:
Create a protection domain for a bundle whether a SecurityManager is present or not.

Modified:
    incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java

Modified: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java?view=diff&rev=498683&r1=498682&r2=498683
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java (original)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Mon
Jan 22 08:35:58 2007
@@ -21,8 +21,7 @@
 import java.io.*;
 import java.net.URL;
 import java.net.URLStreamHandler;
-import java.security.CodeSource;
-import java.security.ProtectionDomain;
+import java.security.*;
 import java.util.*;
 
 import org.apache.felix.framework.cache.*;
@@ -2737,16 +2736,15 @@
         IModule module = m_factory.createModule(
             Long.toString(targetId) + "." + Integer.toString(revision), md);
 
-        if (System.getSecurityManager() != null)
-        {
-            CodeSource codesource = new CodeSource(m_secureAction.createURL(null, 
-                m_cache.getArchive(targetId).getLocation(), 
-                new FakeURLStreamHandler()), 
-                m_cache.getArchive(targetId).getCertificates());
-
-            m_factory.setSecurityContext(module, new ProtectionDomain(codesource,
-                m_secureAction.getPolicy().getPermissions(codesource)));
-        }
+        CodeSource codesource = new CodeSource(m_secureAction.createURL(null, 
+            m_cache.getArchive(targetId).getLocation(), 
+            new FakeURLStreamHandler()), 
+            m_cache.getArchive(targetId).getCertificates());
+
+        Permissions allPerms = new Permissions();
+        allPerms.add(new AllPermission());
+        m_factory.setSecurityContext(module, new ProtectionDomain(codesource,
+			allPerms));
 
         // Create the content loader from the module archive.
         IContentLoader contentLoader = new ContentLoaderImpl(



Mime
View raw message