felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject svn commit: r1196852 - /felix/trunk/framework.security/src/main/java/org/apache/felix/framework/security/util/Permissions.java
Date Wed, 02 Nov 2011 22:49:37 GMT
Author: pauls
Date: Wed Nov  2 22:49:37 2011
New Revision: 1196852

URL: http://svn.apache.org/viewvc?rev=1196852&view=rev
Log:
Don't mess with the target of a file permission.

Modified:
    felix/trunk/framework.security/src/main/java/org/apache/felix/framework/security/util/Permissions.java

Modified: felix/trunk/framework.security/src/main/java/org/apache/felix/framework/security/util/Permissions.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework.security/src/main/java/org/apache/felix/framework/security/util/Permissions.java?rev=1196852&r1=1196851&r2=1196852&view=diff
==============================================================================
--- felix/trunk/framework.security/src/main/java/org/apache/felix/framework/security/util/Permissions.java
(original)
+++ felix/trunk/framework.security/src/main/java/org/apache/felix/framework/security/util/Permissions.java
Wed Nov  2 22:49:37 2011
@@ -336,48 +336,7 @@ public final class Permissions
                     Permission source = createPermission(new PermissionInfo(
                         FilePermission.class.getName(), name,
                         m_permissionInfos[i].getActions()), targetClass);
-                    postfix = "";
-                    name = target.getName();
-                    if (!"<<ALL FILES>>".equals(name))
-                    {
-                        if (name.endsWith("*") || name.endsWith("-"))
-                        {
-                            postfix = name.substring(name.length() - 1);
-                            name = name.substring(0, name.length() - 1);
-                        }
-                        if (!(new File(name)).isAbsolute())
-                        {
-                            BundleContext context = (BundleContext) AccessController
-                                .doPrivileged(new PrivilegedAction()
-                                {
-                                    public Object run()
-                                    {
-                                        return bundle.getBundleContext();
-                                    }
-                                });
-                            if (context == null)
-                            {
-                                break;
-                            }
-                            name = m_action.getAbsolutePath(new File(context
-                                .getDataFile(""), name));
-                        }
-                        if (postfix.length() > 0)
-                        {
-                            if ((name.length() > 0) && !name.endsWith("/"))
-                            {
-                                name += "/" + postfix;
-                            }
-                            else
-                            {
-                                name += postfix;
-                            }
-                        }
-                    }
-                    Permission realTarget = createPermission(
-                        new PermissionInfo(FilePermission.class.getName(),
-                            name, target.getActions()), targetClass);
-                    if (source.implies(realTarget))
+                    if (source.implies(target))
                     {
                         return true;
                     }



Mime
View raw message