From 173b1e83861ec878edc1235a9ac0d2dc9d6d134b Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Fri, 16 Jun 2023 11:38:07 +0200 Subject: [PATCH 1/2] Show a dedicated message when mounting to an occupied Windows drive The error message was restored from 6395f17. Fixes #2309. --- .../common/mount/MountPointInUseException.java | 8 ++++++++ src/main/java/org/cryptomator/common/mount/Mounter.java | 6 +++++- .../ui/unlock/UnlockInvalidMountPointController.java | 2 ++ src/main/resources/i18n/strings.properties | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/main/java/org/cryptomator/common/mount/MountPointInUseException.java diff --git a/src/main/java/org/cryptomator/common/mount/MountPointInUseException.java b/src/main/java/org/cryptomator/common/mount/MountPointInUseException.java new file mode 100644 index 000000000..9f7f11174 --- /dev/null +++ b/src/main/java/org/cryptomator/common/mount/MountPointInUseException.java @@ -0,0 +1,8 @@ +package org.cryptomator.common.mount; + +public class MountPointInUseException extends IllegalMountPointException { + + public MountPointInUseException(String msg) { + super(msg); + } +} diff --git a/src/main/java/org/cryptomator/common/mount/Mounter.java b/src/main/java/org/cryptomator/common/mount/Mounter.java index 0161268f3..a56f2b01b 100644 --- a/src/main/java/org/cryptomator/common/mount/Mounter.java +++ b/src/main/java/org/cryptomator/common/mount/Mounter.java @@ -97,7 +97,11 @@ public class Mounter { } } else { var mpIsDriveLetter = userChosenMountPoint.toString().matches("[A-Z]:\\\\"); - if (!mpIsDriveLetter && canMountToParent && !canMountToDir) { + if (mpIsDriveLetter) { + if (driveLetters.getOccupied().contains(userChosenMountPoint)) { + throw new MountPointInUseException(userChosenMountPoint.toString()); + } + } else if (canMountToParent && !canMountToDir) { MountWithinParentUtil.prepareParentNoMountPoint(userChosenMountPoint); cleanup = () -> { MountWithinParentUtil.cleanup(userChosenMountPoint); diff --git a/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java b/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java index 7bc0cbccd..b07e3ffde 100644 --- a/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java +++ b/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java @@ -1,5 +1,6 @@ package org.cryptomator.ui.unlock; +import org.cryptomator.common.mount.MountPointInUseException; import org.cryptomator.common.mount.MountPointNotExistsException; import org.cryptomator.common.mount.MountPointNotSupportedException; import org.cryptomator.common.vaults.Vault; @@ -41,6 +42,7 @@ public class UnlockInvalidMountPointController implements FxController { var translationKey = switch (e) { case MountPointNotSupportedException x -> "unlock.error.customPath.description.notSupported"; case MountPointNotExistsException x -> "unlock.error.customPath.description.notExists"; + case MountPointInUseException x -> "unlock.error.customPath.description.inUse"; default -> "unlock.error.customPath.description.generic"; }; dialogDescription.setFormat(resourceBundle.getString(translationKey)); diff --git a/src/main/resources/i18n/strings.properties b/src/main/resources/i18n/strings.properties index 43060b7c1..0d9d1bfd5 100644 --- a/src/main/resources/i18n/strings.properties +++ b/src/main/resources/i18n/strings.properties @@ -127,6 +127,7 @@ unlock.success.revealBtn=Reveal Drive unlock.error.customPath.message=Unable to mount vault to custom path unlock.error.customPath.description.notSupported=If you wish to keep using the custom path, please go to the preferences and select a volume type that supports it. Otherwise, go to the vault options and choose a supported mount point. unlock.error.customPath.description.notExists=The custom mount path does not exist. Either create it in your local filesystem or change it in the vault options. +unlock.error.customPath.description.inUse=Drive letter "%s" is already in use. unlock.error.customPath.description.generic=You have selected a custom mount path for this vault, but using it failed with the message: %s ## Hub hub.noKeychain.message=Unable to access device key From 4d09728880b5226ea7f5d03719f176b269389ddb Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Mon, 19 Jun 2023 22:31:50 +0200 Subject: [PATCH 2/2] Suppress a CVE false-positive for jackson-databind 2.14.2 Also see https://github.com/cryptomator/cryptomator/pull/2961#issuecomment-1597652134. --- suppression.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/suppression.xml b/suppression.xml index e7cc4ea65..36b795480 100644 --- a/suppression.xml +++ b/suppression.xml @@ -55,4 +55,12 @@ CVE-2022-45688 - \ No newline at end of file + + + ^pkg:maven/com\.fasterxml\.jackson\.core/jackson\-databind@.*$ + CVE-2023-35116 + + +