trash fails on filesystem whose mount point isn't writable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
trash-cli (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: trash-cli
I run Ubuntu in a VMware Fusion VM on a Mac OS X host machine. I mount the host OS's filesystem in Linux using Fusion's Shared Folders feature, which mounts it at /mnt/hgfs with permissions that don't allow me to modify the mount point itself (although I can modify the files it mounts):
myk@myk:~$ ls -lad /mnt/hgfs
dr-xr-xr-x 1 myk myk 4192 2009-03-09 17:48 /mnt/hgfs
When I try to trash a file on that filesystem using the trash command from the trash-cli package, the program throws an exception because it can't write the file to /mnt/hgfs/
myk@myk:~$ touch /mnt/hgfs/myk/foo
myk@myk:~$ trash /mnt/hgfs/myk/foo
Traceback (most recent call last):
File "/var/lib/
os.
File "/usr/lib/
makedirs(head, mode)
File "/usr/lib/
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/mnt/hgfs/
trash: cannot trash `/mnt/hgfs/
This command should succeed, moving the file to the trash folder in my home directory (~/.local/
myk@myk:~$ lsb_release -rd
Description: Ubuntu 8.10
Release: 8.10
myk@myk:~$ apt-cache policy trash-cli
trash-cli:
Installed: 0.10.r55-0ubuntu1
Candidate: 0.10.r55-0ubuntu1
Version table:
*** 0.10.r55-0ubuntu1 0
500 http://
100 /var/lib/
Changed in trash-cli (Ubuntu): | |
status: | New → Fix Released |
The trash-cli version shipped with ubuntu is quite old.
In the current upstream version it doesn't crash but simply print an error:
$ trash-put --version volume/ .Trash- 1000/ volume/ .Trash- 1000/ volume/ foo': [Errno 13] Permission denied: '/home/ andrea/ Desktop/ bug-ubuntu- 340277/ test-volume/ .Trash- 1000/info'
trash-put 0.2.1
$ sudo mount test-volume.img ./test-volume -o loop
$ sudo mkdir ./test-
$ sudo chmod a-r ./test-
$ trash-put ./test-volume/foo
trash: cannot trash `./test-
I'm hope that the new version could be early packaged in Ubuntu, in the meantime you can install the upstream version with these commands:
sudo apt-get install python-setuptools
sudo easy_install trash-cli
As far I know the trashcan spec does NOT says that "the home trash directory SHALL be used as fallback" but they say that it COULD be used and the choice is up to the implementation. I personally thinks that using it a fallback is not a good idea, but if many users want this I could add this features. If you want this feature fill a bug in http:// code.google. com/p/trash- cli/issues page.