Skip to content

Commit d566e31

Browse files
fixes broken path in certain DirIdChecks
1 parent 07f0a0d commit d566e31

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/main/java/org/cryptomator/cryptofs/health/dirid/DirIdCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void check(Path pathToVault, VaultConfig config, Masterkey masterkey, Cry
6161
boolean foundDir = dirVisitor.secondLevelDirs.remove(expectedDir);
6262
if (foundDir) {
6363
iter.remove();
64-
if (Files.exists(expectedDir.resolve(Constants.DIR_ID_FILE))) {
64+
if (Files.exists(dataDirPath.resolve(expectedDir).resolve(Constants.DIR_ID_FILE))) {
6565
resultCollector.accept(new HealthyDir(dirId, dirIdFile, expectedDir));
6666
} else {
6767
resultCollector.accept(new MissingDirIdBackup(dirId, expectedDir));

src/main/java/org/cryptomator/cryptofs/health/dirid/MissingDirIdBackup.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import org.cryptomator.cryptofs.CryptoPathMapper;
44
import org.cryptomator.cryptofs.DirectoryIdBackup;
55
import org.cryptomator.cryptofs.VaultConfig;
6+
import org.cryptomator.cryptofs.common.Constants;
67
import org.cryptomator.cryptofs.health.api.DiagnosticResult;
78
import org.cryptomator.cryptolib.api.Cryptor;
89
import org.cryptomator.cryptolib.api.Masterkey;
@@ -28,6 +29,7 @@ public String toString() {
2829
@Override
2930
public void fix(Path pathToVault, VaultConfig config, Masterkey masterkey, Cryptor cryptor) throws IOException {
3031
DirectoryIdBackup dirIdBackup = new DirectoryIdBackup(cryptor);
31-
dirIdBackup.execute(new CryptoPathMapper.CiphertextDirectory(dirId, cipherDir));
32+
Path absCipherDir = pathToVault.resolve(Constants.DATA_DIR_NAME).resolve(cipherDir);
33+
dirIdBackup.execute(new CryptoPathMapper.CiphertextDirectory(dirId, absCipherDir));
3234
}
3335
}

0 commit comments

Comments
 (0)