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

trash-put hangs indefinitely if ownership of .Trash-<UID> is wrong #354

Open
acuteaangle opened this issue Oct 13, 2024 · 0 comments
Open

Comments

@acuteaangle
Copy link

Describe the bug
When the ownership of the trash directory is incorrect, trash-put hangs indefinitely trying to trash files.

trash-cli version
0.24.5.26
Originally found in 0.24.4.17; I cloned the latest git tag and confirmed the same behavior.

Operating system:

  • OS: NixOS

To Reproduce

$ cd /external_drive
$ mkdir -p .Trash-$UID
$ bad_uid="$(( $UID + 1 ))"
$ sudo chown $bad_uid:$bad_uid .Trash-$UID
$ touch ./file_to_trash
$ trash-put -vv ./file_to_trash
trash-put: attempt for creating /external_drive/.Trash-1000/info/file_to_trash_35082.trashinfo failed.
trash-put: attempt for creating /external_drive/.Trash-1000/info/file_to_trash_24857.trashinfo failed.
trash-put: attempt for creating /external_drive/.Trash-1000/info/file_to_trash_3626.trashinfo failed.
...

Expected behavior
I would expect trash-cli to fail, since a permission error is not recoverable.
Perhaps something similar to:

...
$ trash-put ./file_to_trash
trash-put: cannot trash regular empty file 'file_to_trash' (from volume '/external_drive')
trash-put: `- failed to trash file_to_trash in /external_drive/.Trash-1000, because failed to create /external_drive/.Trash-1000/info/file_to_trash_12345.trashinfo: Permission denied
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

No branches or pull requests

1 participant