Skip to content

Commit

Permalink
fixes broken path in certain DirIdChecks
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Oct 6, 2022
1 parent 07f0a0d commit d566e31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void check(Path pathToVault, VaultConfig config, Masterkey masterkey, Cry
boolean foundDir = dirVisitor.secondLevelDirs.remove(expectedDir);
if (foundDir) {
iter.remove();
if (Files.exists(expectedDir.resolve(Constants.DIR_ID_FILE))) {
if (Files.exists(dataDirPath.resolve(expectedDir).resolve(Constants.DIR_ID_FILE))) {
resultCollector.accept(new HealthyDir(dirId, dirIdFile, expectedDir));
} else {
resultCollector.accept(new MissingDirIdBackup(dirId, expectedDir));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.cryptomator.cryptofs.CryptoPathMapper;
import org.cryptomator.cryptofs.DirectoryIdBackup;
import org.cryptomator.cryptofs.VaultConfig;
import org.cryptomator.cryptofs.common.Constants;
import org.cryptomator.cryptofs.health.api.DiagnosticResult;
import org.cryptomator.cryptolib.api.Cryptor;
import org.cryptomator.cryptolib.api.Masterkey;
Expand All @@ -28,6 +29,7 @@ public String toString() {
@Override
public void fix(Path pathToVault, VaultConfig config, Masterkey masterkey, Cryptor cryptor) throws IOException {
DirectoryIdBackup dirIdBackup = new DirectoryIdBackup(cryptor);
dirIdBackup.execute(new CryptoPathMapper.CiphertextDirectory(dirId, cipherDir));
Path absCipherDir = pathToVault.resolve(Constants.DATA_DIR_NAME).resolve(cipherDir);
dirIdBackup.execute(new CryptoPathMapper.CiphertextDirectory(dirId, absCipherDir));
}
}

0 comments on commit d566e31

Please sign in to comment.