-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Milestone
Description
To map (virtual) cleartext paths to actual ciphertext paths on the filesystem (e.g. /foo/bar -> /d/00/92jALKJSPPOI...) the class CryptoPathMapper is used.
Inside the class a cache is used for frequent clear->cipher mappings to prevent expensive IO operations. If a path is deleted or moved, the cache must be cleared of such a mapping and of all child mappings.
In the current implemenation this is not the case:
cryptofs/src/main/java/org/cryptomator/cryptofs/CryptoPathMapper.java
Lines 142 to 151 in a1ea3bc
| public void invalidatePathMapping(CryptoPath cleartextPath) { | |
| ciphertextDirectories.asMap().remove(cleartextPath); | |
| } | |
| public void movePathMapping(CryptoPath cleartextSrc, CryptoPath cleartextDst) { | |
| var cachedValue = ciphertextDirectories.asMap().remove(cleartextSrc); | |
| if (cachedValue != null) { | |
| ciphertextDirectories.put(cleartextDst, cachedValue); | |
| } | |
| } |
Only the mapping of the deleted/moved cleartext directory itself is removed, but no children. Hence, the cache contains invalid entries, leading to unexpected errors.
Reactions are currently unavailable