Merge branch 'develop' into feature/vault-format-8

# Conflicts:
#	main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java
This commit is contained in:
Sebastian Stenzel
2021-01-25 21:42:13 +01:00
3 changed files with 7 additions and 27 deletions

View File

@@ -120,6 +120,7 @@ public class Vault {
}
private void destroyCryptoFileSystem(CryptoFileSystem fs) {
LOG.trace("Trying to close associated CryptoFS...");
if (fs != null) {
try {
fs.close();

View File

@@ -36,7 +36,7 @@
<!-- 3rd party dependencies -->
<javafx.version>15</javafx.version>
<commons-lang3.version>3.11</commons-lang3.version>
<jwt.version>3.11.0</jwt.version>
<jwt.version>3.12.0</jwt.version>
<easybind.version>2.1.0</easybind.version>
<guava.version>30.1-jre</guava.version>
<dagger.version>2.31</dagger.version>
@@ -175,13 +175,6 @@
<artifactId>java-jwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!-- fixes CVE-2020-25649, can be removed once https://github.com/auth0/java-jwt/pull/463 is closed and released -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.5.1</version>
</dependency>
<!-- EasyBind -->
<dependency>

View File

@@ -183,15 +183,7 @@ public class UnlockWorkflow extends Task<Boolean> implements MasterkeyFileLoader
assert requirement != MountPointRequirement.PARENT_OPT_MOUNT_POINT; //Not implemented anywhere (yet)
Throwable cause = impExc.getCause();
//Cause is either null (cause the IMPE was thrown directly, e.g. because no MPC succeeded)
//or the cause was not an Exception (but some other kind of Throwable)
//Either way: Handle as generic error
if (!(cause instanceof Exception)) {
handleGenericError(impExc);
return;
}
//From here on handle the cause, not the caught exception
// TODO: apply https://openjdk.java.net/jeps/8213076 in future JDK versions
if (cause instanceof NotDirectoryException) {
if (requirement == MountPointRequirement.PARENT_NO_MOUNT_POINT) {
LOG.error("Unlock failed. Parent folder is missing: {}", cause.getMessage());
@@ -200,23 +192,17 @@ public class UnlockWorkflow extends Task<Boolean> implements MasterkeyFileLoader
}
showInvalidMountPointScene();
return;
}
if (cause instanceof FileAlreadyExistsException) {
} else if (cause instanceof FileAlreadyExistsException) {
LOG.error("Unlock failed. Mountpoint already exists: {}", cause.getMessage());
showInvalidMountPointScene();
return;
}
if (cause instanceof DirectoryNotEmptyException) {
} else if (cause instanceof DirectoryNotEmptyException) {
LOG.error("Unlock failed. Mountpoint not an empty directory: {}", cause.getMessage());
showInvalidMountPointScene();
return;
} else {
handleGenericError(impExc);
}
//Everything else (especially IOException) results in a generic error
//This must be done after the other exceptions because they extend IOException...
handleGenericError(cause);
}
private void showInvalidMountPointScene() {