Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linux: Prevent target file from being trashed when trashing symlink (z…
…ed-industries#22704) Closes zed-industries#22399 Currently, the target file is being trashed when trashing a symlink, and the symlink remains intact. Symlinks are not handled separately yet, so when `open` is used on a symlink, it gets resolved to the target file. To fix this, we can get the file descriptor of the symlink by passing `libc::O_PATH | libc::O_NOFOLLOW` flags to `open`, and then pass this file descriptor to the existing `trash::trash_file` from `ashpd`. However, this would result in an error because `ashpd` currently does not support trashing symlink files. I have created an issue for it here: [https://github.com/bilelmoussaoui/ashpd/issues/255](https://github.com/bilelmoussaoui/ashpd/issues/255). For the time being, this PR partially fixes the issue by removing the symlink without trashing so that the target file won't be affected. Once the upstream bug is fixed, we can switch this remove action back to trashing. Release Notes: - Fixed target file from being trashed when trashing symlink on Linux.
- Loading branch information