Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Georgi2015-02-20 11:20:26 +0000
committerThomas Watson2015-02-23 14:55:25 +0000
commita5a6cedfc2681c3616d20a19d1b1ebc22078ded8 (patch)
treef24ba2c9154eb53cd8dc5a0c049e6f7447768c3a /bundles/org.eclipse.equinox.security
parent836511cda8a0c29ddd87c667c14bf28c2eab6e5e (diff)
downloadrt.equinox.bundles-a5a6cedfc2681c3616d20a19d1b1ebc22078ded8.tar.gz
rt.equinox.bundles-a5a6cedfc2681c3616d20a19d1b1ebc22078ded8.tar.xz
rt.equinox.bundles-a5a6cedfc2681c3616d20a19d1b1ebc22078ded8.zip
Bug 460430 Add environment variable for secure store location
Change-Id: I33309a77b9c188d770ee78334ca93bd9b67b8c6b Signed-off-by: Christian Georgi <christian.georgi@sap.com> Bug: 460430
Diffstat (limited to 'bundles/org.eclipse.equinox.security')
-rw-r--r--bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/SecurePreferencesMapper.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/SecurePreferencesMapper.java b/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/SecurePreferencesMapper.java
index 5fce190b0..44324ae2b 100644
--- a/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/SecurePreferencesMapper.java
+++ b/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/SecurePreferencesMapper.java
@@ -1,12 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2008, 2012 IBM Corporation and others.
+ * Copyright (c) 2008, 2015 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:
* IBM Corporation - initial API and implementation
+ * Christian Georgi (SAP SE) - Bug 460430: environment variable for secure store
*******************************************************************************/
package org.eclipse.equinox.internal.security.storage;
@@ -30,6 +31,11 @@ public class SecurePreferencesMapper {
final private static String KEYRING_ARGUMENT = "-eclipse.keyring"; //$NON-NLS-1$
/**
+ * Environment variable name for the location
+ */
+ final private static String KEYRING_ENVIRONMENT = "ECLIPSE_KEYRING"; //$NON-NLS-1$
+
+ /**
* Command line argument specifying default password
*/
final private static String PASSWORD_ARGUMENT = "-eclipse.password"; //$NON-NLS-1$
@@ -85,7 +91,12 @@ public class SecurePreferencesMapper {
}
}
- // 2) process location
+ // 2) process location from environment
+ String environmentKeyring = System.getenv(KEYRING_ENVIRONMENT);
+ if (location == null && environmentKeyring != null)
+ location = getKeyringFile(environmentKeyring).toURL();
+
+ // 3) process default location
if (location == null)
location = StorageUtils.getDefaultLocation();
if (!StorageUtils.isFile(location))

Back to the top