Skip to content
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

PWX-38618: Add SafeEmptyTrashDir function to Mounter. #2469

Merged
merged 3 commits into from
Aug 28, 2024

Conversation

adityadani
Copy link
Contributor

What this PR does / why we need it:

  • This change introduces a SafeEmptyTrashDir function. The safe implementation will only remove symbolic links if the
    prefix of the target matches with the provided path, to ensure we don't remove any other unrelated symbolic links.
  • The SafeEmptyTrashDir will take in an arbitrary trash location
    and a prefix which needs cleanup.
  • The symbolic links and the target paths will only be cleaned up if the target
    path has the provided prefix.

Which issue(s) this PR fixes (optional)
Closes #
or
PWX-38618

Testing Notes
Added a UT

Special notes for your reviewer:
Add any notes for the reviewer here.

- The SafeEmptyTrashDir will take in an arbitrary trash location
  and a prefix which needs cleanup.
- The symbolic links and the target paths will only be cleaned up if the target
  path has the provided prefix.

fixup: review comments and added a UT
Signed-off-by: Aditya Dani <[email protected]>
Signed-off-by: Aditya Dani <[email protected]>
@adityadani adityadani merged commit daeeb8f into release-9.8 Aug 28, 2024
@adityadani adityadani deleted the PWX-38618-v2 branch August 28, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant