Restore the mount point of a vault whose mount fails to close by running the special cleanup in release()'s finally

This commit is contained in:
Tobias Hagemann
2026-10-14 11:24:15 +02:00
parent 546712dafd
commit de5f0d384e
2 changed files with 2 additions and 1 deletions
@@ -237,11 +237,11 @@ public class Vault {
private void release(Mounter.MountHandle mountHandle) throws UnmountFailedException, IOException {
try {
mountHandle.mountObj().close();
mountHandle.specialCleanup().run();
} finally {
removeFromQuickAccess();
destroyCryptoFileSystem();
this.mountHandle.set(null);
mountHandle.specialCleanup().run();
}
}
@@ -160,6 +160,7 @@ class VaultTest {
vault.lock(false);
Mockito.verify(mount).unmount();
Mockito.verify(specialCleanup).run();
Mockito.verify(cryptoFileSystem).close();
}