After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 108307 - Unable to empty Trash when Trash contents read-only
Unable to empty Trash when Trash contents read-only
Status: RESOLVED OBSOLETE
Product: gnome-vfs
Classification: Deprecated
Component: File operations
2.18.x
Other Linux
: High major
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
: 141134 153907 321478 339596 352666 354394 378365 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-03-13 15:25 UTC by Frederic Crozat
Modified: 2008-12-21 01:20 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
This will rectify probelm (933 bytes, patch)
2005-03-07 07:52 UTC, Anoop
rejected Details | Review

Description Frederic Crozat 2003-03-13 15:25:38 UTC
Follow up of Mdk bug : http://qa.mandrakesoft.com/show_bug.cgi?id=1871

go to home directory
mkdir test
cd test
mkdir test
cd test
touch test
cd
chmod -R a=rx test
chmod u+w test
Open nautilus at home directory
Drag test directory to trash
try emptying trash

sounds convoluted, but it's a reproduction of what happens if you copy a
folder 
from an NTFS partition, then try deleting it.
Comment 1 Sebastien Bacher 2003-11-28 20:29:41 UTC
Still here with nautilus 2.4 => GNOMEVER2.4
Comment 2 Matthew Gatto 2004-05-08 23:32:32 UTC
*** Bug 141134 has been marked as a duplicate of this bug. ***
Comment 3 Matthew Gatto 2004-05-08 23:34:39 UTC
This is a major problem, upgrading Priority -> High, and Severity -> Major.
Comment 4 Anoop 2005-02-20 14:28:26 UTC
At the time of emptying trash  check whether the user has the write permission 
for the trash content .If not we just changing the mode using chmod .This will 
give the expected behaviour..
  
       Whether the approch used is correct ?
Comment 5 Martin Wehner 2005-03-06 15:23:13 UTC
*** Bug 153907 has been marked as a duplicate of this bug. ***
Comment 6 Anoop 2005-03-07 07:52:18 UTC
Created attachment 38355 [details] [review]
This will rectify probelm 

I am attaching a patch.Hope this approch is correct ..Please review the patch
and give a valuable sugg
Anoop
Comment 7 Sebastien Bacher 2005-05-22 13:01:58 UTC
the patch is on gnomevfs, reassigning
Comment 8 Christian Neumair 2005-09-13 10:24:40 UTC
Anoop: Thanks for your efforts! Unfortunately, this patch is not acceptable for
a couple of reasons:
a) you break abstraction. You should use GnomeVFS file info methods instead of
using access and friends, which only works for local files
b) your patch breaks atomocity. If we fail to empty or finally fail to remove
the directory, you should revert the permission change.
c) from taking a short look at the file, there could be a couple more places in
the source code where similar changes will be neccessary
Comment 9 Christian Neumair 2005-09-13 10:24:58 UTC
Sorry for the late response, btw.
Comment 10 Iago Toral 2005-10-20 16:44:45 UTC
Hi!

I think this issue is not related to gnome-vfs but to trash behaviour. When I
try to delete a directory like the one in the example using "rm -r", the system
tries to delete files and directories I have permission to, so I expect the same
behaviuor from gnome-vfs.

If empty trash function should work in a different way then that should be
implemented outside gnome-vfs as it is specific to the trash functionality.
Comment 11 Sebastien Bacher 2006-01-07 12:14:57 UTC
It works fine with the current GNOME for me, does anybody still have this issue?
Comment 12 Daniel Kasak 2006-02-27 05:13:12 UTC
I'm using current gnome ( 2.12.3 ), and I'm seeing exactly the behaviour as reported.
Comment 13 Dean Sas 2006-03-16 11:39:09 UTC
*** Bug 321478 has been marked as a duplicate of this bug. ***
Comment 14 Martin Bergner 2006-03-27 13:22:16 UTC
still happens with 2.14, re-setting version

This bug is now 3 years old!
Comment 15 Scott Henson 2006-07-13 04:51:17 UTC
Might I suggest that the proper behavior is to warn the user when they delete the directory.  gnome-vfs should check the directory tree and inform the user that part of it is read-only and ask them if they want to move it to the trash anyway.  Then when you go to empty the trash it doesn't have to deal with the problem.  
Comment 16 Sven 2006-12-18 10:15:22 UTC
an error message would be nice
Comment 17 Teppo Turtiainen 2007-05-14 20:31:12 UTC
Still occurs with gnome-vfs 2.18.1 on Ubuntu Feisty.
Comment 18 Federico Mena Quintero 2007-05-24 18:24:24 UTC
*** Bug 339596 has been marked as a duplicate of this bug. ***
Comment 19 Joseph Piche 2007-09-10 15:19:33 UTC
Using gnome 2.19.92 on Ubuntu Gutsy, I am not able to recreate this bug. Has it been fixed?
Comment 20 Murray Cumming 2007-09-10 15:37:25 UTC
It's hard to know if this bug has been fixed because nobody has described the symptoms of the problem? What do you see that you should not see?

I do notice that the test folder created according to the instructions is not deleted from the trash when I use "Empty Trash", and I see no error dialog about that. I don't know if that's the original problem.
Comment 21 Frederic Crozat 2007-09-10 16:08:07 UTC
Murray, you're not serious, right ?

I gave an explicit testcase and it is still valid.

If a directory containing a subdirectory which is not writable by user get moved into Trash, you won't be able to empty trash.

Comment 22 Joseph Piche 2007-09-10 16:14:25 UTC
OK. Originally I followed the instructions wrong. However, when following the instructions correctly under 2.19.92, I am given a series of error messages, instead of no error messages like the bug describes.

Is this the correct action though? Because the user still owns the directory, shouldn't he be able to delete it? Example:

cd
touch file
chmod 000 file
rm file

I am able to delete the file. Another example:

cd
mkdir test
chmod 000 test
rmdir test

Again no errors because I own the folder.
Comment 23 Frederic Crozat 2007-09-10 16:47:04 UTC
as an addition to original bug report, it was always complaining with popups since the beginning ;)
Comment 24 Joseph Piche 2007-09-10 17:08:37 UTC
I suppose gnome-vfs and nautilus are treating the files correctly since the same occurs from the terminal:

cd
mkdir -p test/test
touch test/test/file
cd test
chmod -R a-w test
cd
rm -r test

"rm: cannot remove `test/test/file': Permission denied"

I think this bug should probably be marked as fixed since and filed somewhere else like coreutils.
Comment 25 Frederic Crozat 2007-09-10 17:18:21 UTC
in that case, nautilus shouldn't accept to move these files to trash
Comment 26 Murray Cumming 2007-09-10 18:03:58 UTC
> I gave an explicit testcase and it is still valid.

Frederic, you said "try emptying trash". That doesn't describe what you experience. That suggests that we try what you tried so we can experience the same thing. How can we know when we've experienced the same thing? You're not making it easy for anybody to know what the problem is or when it is fixed, regardless of whether there may be several other related problems being discussed here.
Comment 27 Joseph Piche 2007-09-10 20:15:48 UTC
Is it desirable though to have gnome-vfs recursively checking permissions on folders before it moves them to the trash? If it is desirable, would the overhead be acceptable? Especially on large folder hierarchies, it seems like it would be unnecessarily intensive.

Either way, this bug should probably marked as fixed as nautilus is acting correctly when it can't delete files. If something more is going to be done with gnome-vfs or nautilus when moving files into the trash a separate bug should probably be filed.
Comment 28 Teppo Turtiainen 2007-11-24 18:02:15 UTC
*** Bug 378365 has been marked as a duplicate of this bug. ***
Comment 29 Teppo Turtiainen 2007-11-24 18:02:17 UTC
*** Bug 354394 has been marked as a duplicate of this bug. ***
Comment 30 Teppo Turtiainen 2007-11-24 18:02:32 UTC
*** Bug 352666 has been marked as a duplicate of this bug. ***
Comment 31 Joseph Piche 2007-12-11 20:37:02 UTC
I believe this bug should be marked as invalid. To double check, I asked the coreutils mailing list, and the following is expected and desired behavior.

cd
mkdir -p test/test
touch test/test/file
cd test
chmod -R a-w test
cd
rm -r test

"rm: cannot remove `test/test/file': Permission denied"

Gnome-VFS is behaving correctly by giving an error message when trying to empty the trash with test/test/file in it.

I suggest closing this bug. I also believe that Bug 476338 should be looked into since this "bug" is still being reported/duplicated.
Comment 32 Julien Olivier 2007-12-11 22:27:35 UTC
> Gnome-VFS is behaving correctly by giving an error message when trying to empty
> the trash with test/test/file in it.
> 
> I suggest closing this bug. I also believe that Bug 476338 should be looked
> into since this "bug" is still being reported/duplicated.
> 

Joseph,

you're right in saying that gnome-vfs is behaving correctly. But you're missing the point here. The real question is not whether gnome-vfs is behaving correctly but whether the "empty trash" feature is behaving correctly (removing all files from the trash). When a user chooses to empty the trash, nautilus should do its best to satisfy the user, and empty the trash. If it doesn't, it's a bug. In this case Nautilus should try to set all the files and folder writeable before trying to remove them. Then, gnome-vfs would be able to behave correctly by deleting the now writeable files and folders.
Comment 33 Brett Alton 2007-12-12 14:29:54 UTC
I can reproduce this bug...

So all that needs to be fixed is: to tell the Trash only to accept permissions that the user can later delete. If not, change the permissions. If it can't change the permissions under the current user, display and error and don't delete.
Comment 34 Joseph Piche 2007-12-12 14:37:42 UTC
No,

I agree with Julien. Any user should be allowed to move non-writable folders to the trash. The "empty trash" functionality, if it comes across read-only contents, should ask the user whether it should leave the folders/files or attempt to fix the permissions for it to remove the contents.

Nautilus should not interrupt the moving of contents to the trash. This would add a substantial amount of unnecessary overhead.
Comment 35 John Sloan 2008-10-22 14:02:31 UTC
If you expect 'move to trash' to behave the same as 'rm' from the command line, then you should not move read-only objects to the trash folder.

If that is done then 'empty trash' will always be able to complete, since only files which are writable by the user will be in the wastebasket.

This seems logical and consistent.

If you expect different functionality, then any references to what 'rm' does or does not do are not relevant.
Comment 36 A. Walton 2008-12-21 01:20:30 UTC
Closing this bug as obsolete, as we now have a fix in for bug 404600 in GVFS (which is more or less the same bug).