Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2008-11-11 17:24:25 +0000
committerThomas Watson2008-11-11 17:24:25 +0000
commit33ff907d428380c96cd7d1c910182ec8748b044c (patch)
treee4a6269c0ed98979d2d1c05cbe5dc65b56587edb /bundles/org.eclipse.osgi.tests/bundles_src/security.b/security/b
parent9529dec90ed5f3a88499caa84d707de8b89f106d (diff)
downloadrt.equinox.framework-33ff907d428380c96cd7d1c910182ec8748b044c.tar.gz
rt.equinox.framework-33ff907d428380c96cd7d1c910182ec8748b044c.tar.xz
rt.equinox.framework-33ff907d428380c96cd7d1c910182ec8748b044c.zip
Bug 254600 Security problem when calling Bundle.getHeaders()
Diffstat (limited to 'bundles/org.eclipse.osgi.tests/bundles_src/security.b/security/b')
-rw-r--r--bundles/org.eclipse.osgi.tests/bundles_src/security.b/security/b/Activator.java57
1 files changed, 57 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/security.b/security/b/Activator.java b/bundles/org.eclipse.osgi.tests/bundles_src/security.b/security/b/Activator.java
new file mode 100644
index 000000000..d2b6b2d51
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/security.b/security/b/Activator.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * ProSyst Software GmbH - initial API and implementation
+ *******************************************************************************/
+
+package security.b;
+
+import java.util.Dictionary;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ private BundleContext bc;
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ System.out.println("Starting bundle Test2!!");
+ System.out.println("Security manager: "+System.getSecurityManager());
+ this.bc = context;
+ doTestAction();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ System.out.println("Stopping bundle Test2!!");
+ }
+
+ private void doTestAction() {
+ Bundle[] bundles = bc.getBundles();
+ Bundle thisBundle = bc.getBundle();
+ for (int i = 0; i < bundles.length; i++) {
+ if (thisBundle.getBundleId() != bundles[i].getBundleId()) {
+ checkBundle(bundles[i]);
+ }
+ }
+ }
+
+ private void checkBundle(Bundle bundle) {
+ Dictionary headers = bundle.getHeaders();
+
+ }
+}

Back to the top