Clean up AutoRemoveJail, AutoDelete, and AutoUnmount#15079
Merged
Ericson2314 merged 1 commit intomasterfrom Jan 27, 2026
Merged
Clean up AutoRemoveJail, AutoDelete, and AutoUnmount#15079Ericson2314 merged 1 commit intomasterfrom
AutoRemoveJail, AutoDelete, and AutoUnmount#15079Ericson2314 merged 1 commit intomasterfrom
Conversation
0e6dce9 to
ad5a1e1
Compare
xokdvium
reviewed
Jan 26, 2026
ad5a1e1 to
e71b860
Compare
c7694a2 to
6f9c5a7
Compare
xokdvium
reviewed
Jan 26, 2026
6f9c5a7 to
f3668dc
Compare
xokdvium
reviewed
Jan 26, 2026
xokdvium
reviewed
Jan 26, 2026
f3668dc to
3a5c0fa
Compare
xokdvium
reviewed
Jan 26, 2026
xokdvium
reviewed
Jan 26, 2026
xokdvium
reviewed
Jan 26, 2026
985418e to
acce905
Compare
xokdvium
reviewed
Jan 26, 2026
- Extract destructor logic into named methods (`deletePath()`, `unmount()`, and `remove()`) that can be called explicitly. These ones will throw exceptions normally, unlike the destructor which must quash them to avoid double-exceptions. - Use `std::filesystem::path` in `AutoUnmount` (changed from `Path`) - Remove `del` field from `AutoRemoveJail`, using `INVALID_JAIL` sentinel value instead. - Add move assignment operators implemented via friend `swap` functions for all three RAII classes. - Remove old `reset(...)` methods that took parameters. These were a bit misleading --- do they cancel or immediately destroy? --- and doing it explicitly with cancel and then assignment is not hard. Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
008a2e8 to
5dfd81c
Compare
xokdvium
approved these changes
Jan 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Extract destructor logic into named methods (
deletePath(),unmount(), andremove()) that can be called explicitly. These ones will throw exceptions normally, unlike the destructor which must quash them to avoid double-exceptions.Use
std::filesystem::pathinAutoUnmount(changed fromPath)Remove
delfield fromAutoRemoveJail, usingINVALID_JAILsentinel value instead.Add move assignment operators implemented via friend
swapfunctions for all three RAII classes.Remove old
reset(...)methods that took parameters. These were a bit misleading --- do they cancel or immediately destroy? --- and doing it explicitly with cancel and then assignment is not hard.Context
Needed for some sandboxing cleanups.
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.