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

fix(recursiveDelete): Handle symlinked folders correctly #554

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joshtrichards
Copy link
Member

@joshtrichards joshtrichards commented May 3, 2024

#184 added some handling for symlinks in recurseDelete() but only for files, not directories.

We don't use recursiveDelete() is many places where this is likely to happen currently, but since isDir() resolves/matches on symbolic links it's possible we would rmdir() (and so against the getRealPath()) rather than unlink() it. This would result in trying to:

  • run rmdir() against a symlink
  • run rmdir() against the same target more than once

We use recusriveDelete() to:

  • reset the downloads directory (unlikely to be a problem here)
  • reset the shipped apps directory (could be a problem here, but probably not very common admittedly)
  • reset the themes example directory (could be a problem here, but no

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant