Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 229550 Details for
Bug 395274
Equinox returns valid bundle entries for invalid paths
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
alternative fix
rt.equinox.framework.patch (text/plain), 5.85 KB, created by
Thomas Watson
on 2013-04-10 06:52:38 EDT
(
hide
)
Description:
alternative fix
Filename:
MIME Type:
Creator:
Thomas Watson
Created:
2013-04-10 06:52:38 EDT
Size:
5.85 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.osgi >diff --git defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirBundleFile.java defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirBundleFile.java >index 295a866..ae3f4a4 100644 >--- defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirBundleFile.java >+++ defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirBundleFile.java >@@ -28,9 +28,6 @@ > private static final String POINTER_SAME_DIRECTORY_2 = "//";//$NON-NLS-1$ > private static final String POINTER_UPPER_DIRECTORY = "..";//$NON-NLS-1$ > >- private static final String PROPERTY_STRICT_BUNDLE_ENTRY_PATH = "osgi.strictBundleEntryPath";//$NON-NLS-1$ >- private static final String PROPERTY_STRICT_BUNDLE_ENTRY_PATH_DEFAULT_VALUE = "false";//$NON-NLS-1$ >- > private final boolean enableStrictBundleEntryPath; > > /** >@@ -38,12 +35,16 @@ > * @param basefile the base file > * @throws IOException > */ >- public DirBundleFile(File basefile) throws IOException { >- super(basefile); >+ public DirBundleFile(File basefile, boolean enableStrictBundleEntryPath) throws IOException { >+ super(getBaseFile(basefile, enableStrictBundleEntryPath)); > if (!BundleFile.secureAction.exists(basefile) || !BundleFile.secureAction.isDirectory(basefile)) { > throw new IOException(NLS.bind(AdaptorMsg.ADAPTOR_DIRECTORY_EXCEPTION, basefile)); > } >- this.enableStrictBundleEntryPath = Boolean.parseBoolean(BundleFile.secureAction.getProperty(PROPERTY_STRICT_BUNDLE_ENTRY_PATH, PROPERTY_STRICT_BUNDLE_ENTRY_PATH_DEFAULT_VALUE)); >+ this.enableStrictBundleEntryPath = enableStrictBundleEntryPath; >+ } >+ >+ private static File getBaseFile(File basefile, boolean enableStrictBundleEntryPath) throws IOException { >+ return enableStrictBundleEntryPath ? secureAction.getCanonicalFile(basefile) : basefile; > } > > public File getFile(String path, boolean nativeCode) { >diff --git defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java >index 982b816..d4c1b87 100644 >--- defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java >+++ defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/BaseStorage.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2011 IBM Corporation and others. >+ * Copyright (c) 2005, 2013 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -16,6 +16,7 @@ > import java.lang.reflect.InvocationTargetException; > import java.lang.reflect.Method; > import java.net.*; >+import java.security.AccessController; > import java.util.*; > import org.eclipse.core.runtime.adaptor.EclipseStarter; > import org.eclipse.core.runtime.adaptor.LocationManager; >@@ -31,6 +32,7 @@ > import org.eclipse.osgi.framework.internal.core.Constants; > import org.eclipse.osgi.framework.log.FrameworkLogEntry; > import org.eclipse.osgi.framework.util.KeyedHashSet; >+import org.eclipse.osgi.framework.util.SecureAction; > import org.eclipse.osgi.internal.loader.BundleLoader; > import org.eclipse.osgi.internal.loader.BundleLoaderProxy; > import org.eclipse.osgi.service.datalocation.Location; >@@ -49,6 +51,10 @@ > private static final String OPTION_RESOLVER_READER = RUNTIME_ADAPTOR + "/resolver/reader/timing"; //$NON-NLS-1$ > private static final String PROP_FRAMEWORK_EXTENSIONS = "osgi.framework.extensions"; //$NON-NLS-1$ > private static final String PROP_BUNDLE_STORE = "osgi.bundlestore"; //$NON-NLS-1$ >+ >+ static final SecureAction secureAction = AccessController.doPrivileged(SecureAction.createSecureAction()); >+ private static final String PROPERTY_STRICT_BUNDLE_ENTRY_PATH = "osgi.strictBundleEntryPath";//$NON-NLS-1$ >+ private static final String PROPERTY_STRICT_BUNDLE_ENTRY_PATH_DEFAULT_VALUE = "false";//$NON-NLS-1$ > // The name of the bundle data directory > static final String DATA_DIR_NAME = "data"; //$NON-NLS-1$ > static final String LIB_TEMP = "libtemp"; //$NON-NLS-1$ >@@ -740,10 +746,12 @@ > // No factories configured or they declined to create the bundle file; do default > if (result == null && content instanceof File) { > File file = (File) content; >- if (isDirectory(data, base, file)) >- result = new DirBundleFile(file); >- else >+ if (isDirectory(data, base, file)) { >+ boolean strictPath = Boolean.parseBoolean(secureAction.getProperty(PROPERTY_STRICT_BUNDLE_ENTRY_PATH, PROPERTY_STRICT_BUNDLE_ENTRY_PATH_DEFAULT_VALUE)); >+ result = new DirBundleFile(file, strictPath); >+ } else { > result = new ZipBundleFile(file, data, mruList); >+ } > } > > if (result == null && content instanceof String) { >diff --git security/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java security/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java >index 58e417d..f589aa7 100644 >--- security/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java >+++ security/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006, 2010 IBM Corporation and others. >+ * Copyright (c) 2006, 2013 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -248,7 +248,7 @@ > throw new IllegalArgumentException("null content"); //$NON-NLS-1$ > BundleFile contentBundleFile; > if (content.isDirectory()) >- contentBundleFile = new DirBundleFile(content); >+ contentBundleFile = new DirBundleFile(content, false); > else > contentBundleFile = new ZipBundleFile(content, null); > SignedBundleFile result = new SignedBundleFile(null, VERIFY_ALL);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 395274
:
224051
|
226730
|
229125
|
229500
|
229529
| 229550