summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Campo2008-01-17 09:50:35 (EST)
committerChristian Campo2008-01-17 09:50:35 (EST)
commit56b99d696974196f73d02a2379782505577be909 (patch)
tree0d220abbf5bd11cbe964da0e26c4ccfa0fd84ff6
parent82d7b045e9868e519bec65813fed2f8de10cae2d (diff)
downloadorg.eclipse.riena.old-56b99d696974196f73d02a2379782505577be909.zip
org.eclipse.riena.old-56b99d696974196f73d02a2379782505577be909.tar.gz
org.eclipse.riena.old-56b99d696974196f73d02a2379782505577be909.tar.bz2
initial checkin
-rw-r--r--org.eclipse.riena.security.common.bootpolicy/.classpath7
-rw-r--r--org.eclipse.riena.security.common.bootpolicy/.project28
-rw-r--r--org.eclipse.riena.security.common.bootpolicy/META-INF/MANIFEST.MF9
-rw-r--r--org.eclipse.riena.security.common.bootpolicy/about.html24
-rw-r--r--org.eclipse.riena.security.common.bootpolicy/build.properties4
-rw-r--r--org.eclipse.riena.security.common.bootpolicy/lib/bootpolicy.jarbin0 -> 2647 bytes
-rw-r--r--org.eclipse.riena.security.common.bootpolicy/src/org/eclipse/riena/security/common/bootpolicy/Activator.java62
-rw-r--r--org.eclipse.riena.security.common.bootpolicy/src/org/eclipse/riena/security/common/bootpolicy/BootPolicy.java98
8 files changed, 232 insertions, 0 deletions
diff --git a/org.eclipse.riena.security.common.bootpolicy/.classpath b/org.eclipse.riena.security.common.bootpolicy/.classpath
new file mode 100644
index 0000000..751c8f2
--- /dev/null
+++ b/org.eclipse.riena.security.common.bootpolicy/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.riena.security.common.bootpolicy/.project b/org.eclipse.riena.security.common.bootpolicy/.project
new file mode 100644
index 0000000..cf8a62f
--- /dev/null
+++ b/org.eclipse.riena.security.common.bootpolicy/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.riena.security.common.bootpolicy</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.riena.security.common.bootpolicy/META-INF/MANIFEST.MF b/org.eclipse.riena.security.common.bootpolicy/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..ca9156f
--- /dev/null
+++ b/org.eclipse.riena.security.common.bootpolicy/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Policyproxy Plug-in
+Bundle-SymbolicName: org.eclipse.riena.security.common.bootpolicy
+Bundle-Version: 1.0.0
+Bundle-Activator: org.eclipse.riena.security.common.bootpolicy.Activator
+Require-Bundle: org.eclipse.core.runtime
+Eclipse-LazyStart: true
+Export-Package: org.eclipse.riena.security.common.bootpolicy
diff --git a/org.eclipse.riena.security.common.bootpolicy/about.html b/org.eclipse.riena.security.common.bootpolicy/about.html
new file mode 100644
index 0000000..fc81119
--- /dev/null
+++ b/org.eclipse.riena.security.common.bootpolicy/about.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head><body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+<div style="position: absolute; width: 28px; height: 28px; z-index: 1000; display: none;"></div><img style="position: absolute; width: 35px; height: 29px; z-index: 1000; display: none;" src="about-Dateien/launch.png"></body></html> \ No newline at end of file
diff --git a/org.eclipse.riena.security.common.bootpolicy/build.properties b/org.eclipse.riena.security.common.bootpolicy/build.properties
new file mode 100644
index 0000000..34d2e4d
--- /dev/null
+++ b/org.eclipse.riena.security.common.bootpolicy/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/org.eclipse.riena.security.common.bootpolicy/lib/bootpolicy.jar b/org.eclipse.riena.security.common.bootpolicy/lib/bootpolicy.jar
new file mode 100644
index 0000000..5611cdd
--- /dev/null
+++ b/org.eclipse.riena.security.common.bootpolicy/lib/bootpolicy.jar
Binary files differ
diff --git a/org.eclipse.riena.security.common.bootpolicy/src/org/eclipse/riena/security/common/bootpolicy/Activator.java b/org.eclipse.riena.security.common.bootpolicy/src/org/eclipse/riena/security/common/bootpolicy/Activator.java
new file mode 100644
index 0000000..75b4b8a
--- /dev/null
+++ b/org.eclipse.riena.security.common.bootpolicy/src/org/eclipse/riena/security/common/bootpolicy/Activator.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2007 compeople AG 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:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.security.common.bootpolicy;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.riena.security.common.bootpolicy";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/org.eclipse.riena.security.common.bootpolicy/src/org/eclipse/riena/security/common/bootpolicy/BootPolicy.java b/org.eclipse.riena.security.common.bootpolicy/src/org/eclipse/riena/security/common/bootpolicy/BootPolicy.java
new file mode 100644
index 0000000..a67856c
--- /dev/null
+++ b/org.eclipse.riena.security.common.bootpolicy/src/org/eclipse/riena/security/common/bootpolicy/BootPolicy.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2007 compeople AG 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:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.security.common.bootpolicy;
+
+import java.security.CodeSource;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Policy;
+import java.security.ProtectionDomain;
+
+import sun.security.provider.PolicyFile;
+
+/**
+ *
+ */
+public class BootPolicy extends Policy {
+
+ // private static Policy realPolicy;
+ //
+ // public static void setRealPolicy(Policy parmPolicy) {
+ // System.out.println("proxy: setRealPolicy");
+ // realPolicy = parmPolicy;
+ // }
+ private Policy defaultPolicy = new PolicyFile();
+
+ /**
+ *
+ */
+ public BootPolicy() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.security.Policy#getPermissions(java.security.CodeSource)
+ */
+ @Override
+ public PermissionCollection getPermissions(CodeSource codesource) {
+ System.out.println("defaultPolicy: getPermissions");
+ // if (realPolicy != null) {
+ // return realPolicy.getPermissions(codesource);
+ // }
+ // // TODO Auto-generated method stub
+ return defaultPolicy.getPermissions(codesource);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.security.Policy#refresh()
+ */
+ @Override
+ public void refresh() {
+ System.out.println("defaultPolicy: refresh");
+ // if (realPolicy != null) {
+ // realPolicy.refresh();
+ // }
+ defaultPolicy.refresh();
+ }
+
+ @Override
+ public PermissionCollection getPermissions(ProtectionDomain domain) {
+ System.out.println("defaultPolicy: getPermissions");
+ // if (realPolicy != null) {
+ // return realPolicy.getPermissions(domain);
+ // }
+ return defaultPolicy.getPermissions(domain);
+ }
+
+ @Override
+ public boolean implies(ProtectionDomain domain, Permission permission) {
+ System.out.print("(X)");
+ // if (realPolicy != null) {
+ // return realPolicy.implies(domain, permission);
+ // }
+ boolean perm = defaultPolicy.implies(domain, permission);
+ if (!perm) {
+ if (permission.getClass().getName().contains("ApplicationAdminPermission")) {
+ System.err.println("allow ApplicationAdminPermission");
+ return true;
+ }
+ System.out.println("not allowed to " + permission);
+ }
+ return perm;
+ // return true; // TODO return true while there is no REAL POLICY
+ // return super.implies(domain, permission);
+ }
+
+}