-
Notifications
You must be signed in to change notification settings - Fork 379
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
Stay beneath data dir / run dir when cleaning up paths during reset #5187
Open
twz123
wants to merge
3
commits into
k0sproject:main
Choose a base branch
from
twz123:reset-cleanup-beneath-directory
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,518
−6
Conversation
This file contains 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
The DirFD newtype around os.File provides methods for opening, statting and listing files or directories relative to a dirfd file descriptor. Provides robust handling of directory relative operations, maintaining directory access consistency across rename/move operations. Signed-off-by: Tom Wieczorek <[email protected]>
twz123
force-pushed
the
reset-cleanup-beneath-directory
branch
2 times, most recently
from
November 7, 2024 16:38
d1a4c89
to
ec2fd13
Compare
The current way of cleaning up the data directory is too simple to ensure that the recursive directory removal won't remove data that's not beneath it. Re-implement the recursive directory traversal in a way that won't cross mount points unintentionally, but unmounts everything recursively instead. Signed-off-by: Tom Wieczorek <[email protected]>
Add a script to the reset integration test that tries to clutter the data directory by placing files and directories with odd permissions, adding symlinks to stuff outside the data directory, and adding bind mounts in various ways. This is to prove that k0's reset will never delete anything that is not beneath the data directory. Signed-off-by: Tom Wieczorek <[email protected]>
twz123
force-pushed
the
reset-cleanup-beneath-directory
branch
from
November 7, 2024 16:52
ec2fd13
to
ee8b1a0
Compare
I have a simpler alternative #5193 |
16 tasks
This pull request has merge conflicts that need to be resolved. |
16 tasks
The PR is marked as stale since no activity has been recorded in 30 days |
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.
Description
The current way of cleaning up the data directory is too simple to ensure that the recursive directory removal won't remove data that's not beneath it.
Re-implement the recursive directory traversal in a way that won't cross mount points unintentionally, but unmounts everything recursively instead.
Add a script to the reset integration test that tries to clutter the data directory by placing files and directories with odd permissions, adding symlinks to stuff outside the data directory, and adding bind mounts in various ways. This is to prove that k0's reset will never delete anything that is not beneath the data directory.
Fixes #4318.
Type of change
How Has This Been Tested?
Checklist: