felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject svn commit: r634459 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java
Date Thu, 06 Mar 2008 23:45:13 GMT
Author: pauls
Date: Thu Mar  6 15:45:13 2008
New Revision: 634459

URL: http://svn.apache.org/viewvc?rev=634459&view=rev
Log:
Bundle.getResource does not check for AdminPermission, like getResources does. This adds the
permission check. (FELIX-150)

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

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java?rev=634459&r1=634458&r2=634459&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java Thu Mar
 6 15:45:13 2008
@@ -167,6 +167,21 @@
     **/
     public URL getResource(String name)
     {
+        Object sm = System.getSecurityManager();
+
+        if (sm != null)
+        {
+            try
+            {
+                ((SecurityManager) sm).checkPermission(new AdminPermission(this,
+                    AdminPermission.RESOURCE));
+            }
+            catch (Exception e)
+            {
+                return null; // No permission
+            }
+        }
+
         return m_felix.getBundleResource(this, name);
     }
 



Mime
View raw message