diff --git a/bundles/org.eclipse.equinox.security/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.security/META-INF/MANIFEST.MF index 9afca8fcef3..b46e13d2242 100644 --- a/bundles/org.eclipse.equinox.security/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.security/META-INF/MANIFEST.MF @@ -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 diff --git a/bundles/org.eclipse.equinox.security/pom.xml b/bundles/org.eclipse.equinox.security/pom.xml index 513f82f3ac2..4ff9f30922c 100644 --- a/bundles/org.eclipse.equinox.security/pom.xml +++ b/bundles/org.eclipse.equinox.security/pom.xml @@ -19,7 +19,7 @@ org.eclipse.equinox org.eclipse.equinox.security - 1.4.300-SNAPSHOT + 1.4.400-SNAPSHOT eclipse-plugin 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 685af7e1404..84c631cefe5 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,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 @@ -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; @@ -170,7 +171,13 @@ private static Map processPassword(Map 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);