Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#652 Handle @user.home in -eclipse.password file retrieval #653

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundles/org.eclipse.equinox.security/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.security;singleton:=true
Bundle-Version: 1.4.300.qualifier
Bundle-Version: 1.4.400.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-Activator: org.eclipse.equinox.internal.security.auth.AuthPlugin
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.equinox.security/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.security</artifactId>
<version>1.4.300-SNAPSHOT</version>
<version>1.4.400-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2018 IBM Corporation and others.
* Copyright (c) 2008, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -11,6 +11,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Christian Georgi (SAP SE) - Bug 460430: environment variable for secure store
* Maxime Porhel (Obeo) - #652: handle @user.home in -eclipse.password file retrieval
*******************************************************************************/
package org.eclipse.equinox.internal.security.storage;

Expand Down Expand Up @@ -170,7 +171,13 @@ private static Map<Object, Object> processPassword(Map<Object, Object> options,
if (arg == null || arg.isEmpty()) {
return options;
}
Path file = Path.of(arg);

String path = arg;
if (path.startsWith('@' + USER_HOME)) {
path = System.getProperty(USER_HOME, "") + path.substring(USER_HOME.length() + 1); //$NON-NLS-1$
}

Path file = Path.of(path);
if (!Files.isReadable(file)) {
String msg = NLS.bind(SecAuthMessages.unableToReadPswdFile, arg);
AuthPlugin.getDefault().logError(msg, null);
Expand Down
Loading