-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Custom filesystem exception for invalid ciphertext nodes #286
Conversation
WalkthroughThis pull request involves updates to exception handling in the Possibly related PRs
Suggested labels
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
This PR changes an error behavior of the filesystem.
On the encrypted/ciphertext side, Cryptofs can represent decrypted/cleartext filenodes either as single files or directories. In the latter case the directory must contain any identification files in order to be recognized. (dir.c9r, symlink.c9r, etc)
In the current version, if such a file was not present, a
NoSuchFileException
is thrown. But this exception does not represent the actual state of the filesystem node: Instead of not being present, it is broken. And with the wrong exception library consumer might be tempted to use the "free" path, albeit it is not, only running into the next exception.I replaced the wrong exception with a new, custom
FileSystemException
: InvalidFileNodeException. The consumer does not know about it and recieves ultimately a generic IOException, indicating there is something wrong with the filesystem node.