Krzysztof Daniel 65326ea
--- rt.equinox.framework/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java	2012-05-05 14:41:12.000000000 +0200
Krzysztof Daniel 65326ea
+++ rt.equinox.framework/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java	2012-05-18 15:28:28.553493782 +0200
Krzysztof Daniel 65326ea
@@ -8,7 +8,7 @@
Krzysztof Daniel 65326ea
  * Contributors:
Krzysztof Daniel 65326ea
  *     IBM Corporation - initial API and implementation
Krzysztof Daniel 65326ea
  *     Anton Leherbauer (Wind River Systems) - bug 301226
Krzysztof Daniel 65326ea
- *     Red Hat Inc. - bug 373640
Krzysztof Daniel 65326ea
+ *     Red Hat Inc. - bug 373640, 379102
Krzysztof Daniel 65326ea
  *******************************************************************************/
Krzysztof Daniel 65326ea
 package org.eclipse.equinox.launcher;
Krzysztof Daniel 65326ea
 
Krzysztof Daniel 65326ea
@@ -235,6 +235,9 @@
Krzysztof Daniel 65326ea
 	protected BufferedWriter log = null;
Krzysztof Daniel 65326ea
 	protected boolean newSession = true;
Krzysztof Daniel 65326ea
 
Krzysztof Daniel 65326ea
+	private boolean forbiddenMasterEclipse;
Krzysztof Daniel 65326ea
+   private static final String FORBIDDEN_MASTER_ECLIPSE = "-preventMasterEclipseLaunch";
Krzysztof Daniel 65326ea
+
Krzysztof Daniel 65326ea
 	// for variable substitution
Krzysztof Daniel 65326ea
 	public static final String VARIABLE_DELIM_STRING = "$"; //$NON-NLS-1$
Krzysztof Daniel 65326ea
 	public static final char VARIABLE_DELIM_CHAR = '$';
Krzysztof Daniel 65326ea
@@ -555,6 +558,12 @@
Krzysztof Daniel 65326ea
 		setupVMProperties();
Krzysztof Daniel 65326ea
 		processConfiguration();
Krzysztof Daniel 65326ea
 
Krzysztof Daniel 65326ea
+if (forbiddenMasterEclipse && System.getProperty(PROP_SHARED_CONFIG_AREA) == null) { //$NON-NLS-1$
Krzysztof Daniel 65326ea
+           System.err.println("This application should not be run by the owner of the shared configuration.");
Krzysztof Daniel 65326ea
+           System.setProperty(PROP_EXITCODE, "" + 14); //$NON-NLS-1$
Krzysztof Daniel 65326ea
+           return;
Krzysztof Daniel 65326ea
+       }
Krzysztof Daniel 65326ea
+
Krzysztof Daniel 65326ea
 		// need to ensure that getInstallLocation is called at least once to initialize the value.
Krzysztof Daniel 65326ea
 		// Do this AFTER processing the configuration to allow the configuration to set
Krzysztof Daniel 65326ea
 		// the install location.  
Krzysztof Daniel 65326ea
@@ -1532,6 +1541,10 @@
Krzysztof Daniel 65326ea
 				// passed thru this arg (i.e., do not set found = true)
Krzysztof Daniel 65326ea
 				continue;
Krzysztof Daniel 65326ea
 			}
Krzysztof Daniel 65326ea
+ if (args[i].equalsIgnoreCase(FORBIDDEN_MASTER_ECLIPSE)) {
Krzysztof Daniel 65326ea
+               forbiddenMasterEclipse = true;
Krzysztof Daniel 65326ea
+               found = true;
Krzysztof Daniel 65326ea
+           }
Krzysztof Daniel 65326ea
 
Krzysztof Daniel 65326ea
 			// check if development mode should be enabled for the entire platform
Krzysztof Daniel 65326ea
 			// If this is the last arg or there is a following arg (i.e., arg+1 has a leading -),