andreafrancia / trash-cli

Command line interface to the freedesktop.org trashcan.
GNU General Public License v2.0
3.58k stars 179 forks source link

I can only trash one file on an ExFat external drive #253

Open stephane-archer opened 1 year ago

stephane-archer commented 1 year ago

I can only trash one file on an ExFat external drive I use the current latest version 0.22.8.27

To start fresh I run the following command: rm -r .Trash-1000/ .Trash/ then I create my fist file and trash it

touch toto
trash --verbose toto
    trash: volume of file: /mnt/ssd3
    trash: trying trash dir: /home/fractale/.local/share/Trash from volume: /
    trash: won't use trash dir ~/.local/share/Trash because its volume (/) in a different volume than toto (/mnt/ssd3)
    trash: found unusable .Trash dir (should be a dir): /mnt/ssd3/.Trash
    trash: trash directory /mnt/ssd3/.Trash/1000 is not secure
    trash: trying trash dir: /mnt/ssd3/.Trash-1000 from volume: /mnt/ssd3
    trash: 'toto' trashed in /mnt/ssd3/.Trash-1000

The file has disappeared! now let's try to create a new file with a different name

touch bar
trash --verbose bar
    trash: volume of file: /mnt/ssd3
    trash: trying trash dir: /home/fractale/.local/share/Trash from volume: /
    trash: won't use trash dir ~/.local/share/Trash because its volume (/) in a different volume than bar (/mnt/ssd3)
    trash: found unusable .Trash dir (should be a dir): /mnt/ssd3/.Trash
    trash: trash directory /mnt/ssd3/.Trash/1000 is not secure
    trash: trying trash dir: /mnt/ssd3/.Trash-1000 from volume: /mnt/ssd3
    trash: Failed to trash bar in /mnt/ssd3/.Trash-1000, because: [Errno 1] Operation not permitted: '/mnt/ssd3/.Trash-1000'
    trash: cannot trash regular empty file 'bar'

the file is still here! it's probably because .Trash-1000 doesn't have the proper permission

drwxrwxrwx 1 root root 131072 Oct  4 01:39  .Trash-1000/

but it looks to have all the permissions set. but let's try to set the permissions just to be sure, there is a sticky bit to set and I never use that before

sudo chmod 1777 .Trash-1000/
    chmod: changing permissions of '.Trash-1000/': Operation not permitted
sudo chmod +t .Trash-1000/
    chmod: changing permissions of '.Trash-1000/': Operation not permitted

How can it be not permitted with sudo?

Ok let's try something else Let's look at the .Trash directory the logs say: found unusable .Trash dir (should be a dir): /mnt/ssd3/.Trash but there is no file or anything call .Trash Let's create it!

mkdir .Trash
sudo chmod a+rw .Trash/
sudo chmod +t .Trash/
    chmod: changing permissions of '.Trash/': Operation not permitted
sudo chmod 1777 .Trash/
    chmod: changing permissions of '.Trash/': Operation not permitted

I can't make .Trash/ sticky! I use chmod (GNU coreutils) 8.30 and I'm on Linux Mint 20.3 Una with FUSE exfat 1.3.0

I hope this will help you understand the problem and what I tried