trash-cli icon indicating copy to clipboard operation
trash-cli copied to clipboard

trash-empty ignores NFS mountpoints

Open ytoku opened this issue 2 years ago • 2 comments

Describe the bug

trash-empty command does not list and clean NFS mountpoints.

The problem was introduced at commit 22e655b3 to solve issue #214. PR #178 fixed same problem before.

trash-cli version

trash-put 0.22.4.16

Operating system:

Ubuntu 22.04

To Reproduce

  1. Mount NFS
  2. Execute trash-empty
$ sudo mount -t nfs4 nfsserver:/export /mnt/nfs
$ trash-empty        
Would empty the following trash directories:
    - /home/user/.local/share/Trash
    - /.Trash-1000
    - /home/.Trash-1000
    - /boot/.Trash-1000
    - /boot/efi/.Trash-1000
Proceed? (y/n) 

Expected behavior

trash-empty should list and clean trash directories in NFS mountpoints too.

$ sudo mount -t nfs4 nfsserver:/export /mnt/nfs
$ trash-empty        
Would empty the following trash directories:
    - /home/user/.local/share/Trash
    - /.Trash-1000
    - /home/.Trash-1000
    - /boot/.Trash-1000
    - /boot/efi/.Trash-1000
    - /mnt/nfs/.Trash-1000
Proceed? (y/n) 

Or trash-empty should check all mountpoints and simply ignore it if the trash directory does not exist.

$ sudo mount -t nfs4 nfsserver:/export /mnt/nfs
$ trash-empty        
Would empty the following trash directories:
    - /home/user/.local/share/Trash
    - /mnt/nfs/.Trash-1000
Proceed? (y/n) 

Related issues

issue #214, PR #178

ytoku avatar Apr 30 '22 17:04 ytoku

Understood.

Unfortunately at the moment I am unable to implement the solution soon. If anyone wants to send a pull request they are welcome.

andreafrancia avatar May 05 '22 18:05 andreafrancia

I installed trash-cli with pip today, and found that I needed to use the fix in PR https://github.com/andreafrancia/trash-cli/pull/230 in order for the trash-list command to list the items trashed on my primary NFS filesystem.

ehusby avatar Aug 15 '22 06:08 ehusby

The PR #230 seems good, I just need someone that can test it on an environment with NFS mount points. At the moment I don't have yet access to any machine with NFS where I can test trash-cli. If you want to use #230 PR try this:

$ pip uninstall trash-cli
$ pip install git+https://github.com/masgouri/trash-cli@patch-1

If the patch works please add a comment to this page letting me know. I will merge the patch.

andreafrancia avatar Aug 19 '22 06:08 andreafrancia

The patch as applied through pip install works for me!

ehusby avatar Aug 19 '22 06:08 ehusby

Thank you @ehusby

andreafrancia avatar Aug 19 '22 17:08 andreafrancia

nfs fstype is fixed by #230, but nfs4 fstype is not still fixed. Please merge #244.

ytoku avatar Aug 26 '22 18:08 ytoku

Merged! Thank you @ytoku

andreafrancia avatar Aug 27 '22 20:08 andreafrancia