! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Thunar sometimes mounts USB drives with root permission
Status:
RESOLVED: MOVED

Comments

Description cjdg 2018-09-25 21:12:00 CEST
Using Ubuntu Studio 18.04 sometimes thunar opens thumbdrives and drives as read only, but they work fine using terminal
Comment 1 alexxcons editbugs 2018-12-28 00:23:28 CET
Same bug on launchpad:
https://bugs.launchpad.net/ubuntu/+source/thunar/+bug/1332623

Related Forum thread:
https://forum.xfce.org/viewtopic.php?id=12541

Can be reproduced like that:
1.) After a reboot 8or before) , plug in a USB stick (or USB HDD or card reader)
2.) In thunar Right->Click eject the drive
3.) Plug it out and than in again
--> Now with only your mouse (or Ctrl+V), you cannot paste files or create a new folder/file.

Seems to be a thunar  problem, since nautilus does not suffer from it.
Comment 2 Andre Miranda editbugs 2018-12-28 00:30:50 CET
I can reproduce after the thumbdrive is ejected/reinserted or unmounted/mounted.
Workaround: close Thunar window and reopen.
So probably Thunar is storing some messed up state.
Comment 3 Alistair Buxton 2018-12-28 00:34:20 CET
According to the LP bug this is fixed by https://bugzilla.gnome.org/show_bug.cgi?id=787731

However Ubuntu 18.04 has glib 2.56.1 and this bug still happens. It is probably a good place to start looking though.
Comment 4 groucho 2019-01-09 16:56:00 CET
I can reproduce this with glib 2.58.2 and thunar 1.8.2.

Another workaround (that might also help debugging this, maybe):
- go up one level from the USB drive's root folder (e.g. from /run/media/username/usbdrivename to /run/media/username).
- now the user should own /run/media/username and have permission to write on the drive.
- if /run/media/username is still marked as owned by root, refreshing the view (with ctrl+R or F5) of /run/media/username solves the issue.
Comment 5 alexxcons editbugs 2019-01-13 23:59:21 CET
Created attachment 8242 
WIP patch

The actual problem seems to be, that the GFileInfo of the related ThunarFIle is not reloaded / the related Thunarfile is not removed after eject.

The attached patch fixes that by reloading the ThunarFile.
Now for "eject + re-plug", things are fine.

However if the volume is plugged out without pressing "eject" before and re-plugged in, than first the view will be empty / will show nothing.
Just selecting some other volume and than re-selecting the usb-stick fixed this glitch.

So it looks like something else (the view? ) needs to be triggered for reload as well .. to be further checked.
Comment 6 alexxcons editbugs 2019-01-21 23:11:39 CET
Created attachment 8257 
patch

The attached patch fixes the bug, but ...

- It fixes the symptoms, not the actual problem.
As far as I can tell, the actual problem is, that after "eject" we still have a ThunarFile, a Volume and a ThunarDevice for the mount ... so far I did not find out why that is the case. To be further investigated.

Since I would like to release thunar 1.8.3 soon, I am thinking about pushing the patch above, but keeping this bug open for further investigation. You think that sounds like a good idea ?

The above described problem (unplug without eject) is a seperate bug, which as well happened before. Not related to this one ( WIll open a new bug for it )
Comment 7 alexxcons editbugs 2019-01-22 10:19:27 CET
Here the new bug for the problem described above: Bug #15071
Comment 8 Git Bot editbugs 2019-01-24 21:57:31 CET
Alexander Schwinn referenced this bugreport in commit 65f1675fa3a2f45bf71588ecdedefa687e6fa733

Thunar sometimes mounts USB drives with root permission (Bug #14719)

https://git.xfce.org/xfce/thunar/commit?id=65f1675fa3a2f45bf71588ecdedefa687e6fa733
Comment 9 Git Bot editbugs 2019-01-24 22:00:14 CET
Alexander Schwinn referenced this bugreport in commit d73bb5fb601a761744f05c213f70b6cddce889f3

Thunar sometimes mounts USB drives with root permission (Bug #14719)

https://git.xfce.org/xfce/thunar/commit?id=d73bb5fb601a761744f05c213f70b6cddce889f3
Comment 10 Git Bot editbugs 2019-01-24 22:03:30 CET
Alexander Schwinn referenced this bugreport in commit 81fc76226596a82b50c08fa2a2ab50f619ffa1a3

Thunar sometimes mounts USB drives with root permission (Bug #14719)

https://git.xfce.org/xfce/thunar/commit?id=81fc76226596a82b50c08fa2a2ab50f619ffa1a3
Comment 11 Git Bot editbugs 2020-05-26 23:38:10 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/thunar/-/issues/211.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #14719

Reported by:
cjdg
Reported on: 2018-09-25
Last modified on: 2020-05-26

People

Assignee:
Xfce Bug Triage
CC List:
6 users

Version

Version:
unspecified

Attachments

WIP patch (10.00 KB, patch)
2019-01-13 23:59 CET , alexxcons
no flags
patch (2.47 KB, patch)
2019-01-21 23:11 CET , alexxcons
no flags

Additional information