Xfce Forum

Sub domains

You are not logged in.

#1 2018-11-09 00:03:26

Registered: 2018-11-06
Posts: 3

Thunar mounts USB drives with (false?) root permission


I found out a weird behaviour of thunar (or thunar-volman?), which can be duplicated on both Xubuntu and Arch, with several USB ports on several computers.

Here are the steps to duplicate this problem:

a) After a reboot, plug in a USB stick (or USB HDD or card reader), everything is fine;

Say, the USB device is at /dev/sdb, and the mount point at:
/media/my_username/USB_STICK in Xubuntu, or
/run/media/my_username/USB_STICK in Arch

It can be mounted with my_username's permission. With a mouse, you can paste files into the USB drives (or Ctrl+V).

So far, so good.

b) If this USB stick is ejected (by clicking the "eject button" in the Side Pane under DEVICES in Thunar), unplugged then plugged back in, the mount point now has a root permission.

Now with only your mouse (or Ctrl+V), you cannot paste files or create a new folder/file.

c) Enabling/Disabling Volume Management has no effect; Changing USB ports has no effect.

It means, in an home/office environment, if you plug in a USB drive, copy some files and share it with others, then when you plug this USB drive back in your PC again, you cannot copy/paste again without using terminal or rebooting the machine.

d) It doesn't seem to be a gvfs/udisk2 bug, because Nautilus always mounts correctly. Below is a screenshot of the mount point directory's property shown by the file managers.

What's odd is this: the mount point actually doesn't have root permission.

If you copy files in terminal (in Arch):

$ cp abc.txt "/run/media/my_username/USB_STICK"

It works, without requiring sudo or root permission.

Checking permission (in Arch):

ls -la "/run/media/my_username/USB_STICK"
total 32
drwxrwxrwx 1 my_username users 32768 Nov  8 15:45 .
drwxr-xr-x 4 root root     80 Nov  8 15:33 ..

"." indicates that this directory has user permission, not root.

This goes away after a reboot only for the 1st plugging in, and it reappears starting at the 2nd time you plug in the USB drive.

Is this a bug or maybe by design? If the former, how can we fix it?


Last edited by ArON (2018-11-09 00:11:54)


#2 2018-11-09 02:37:01

From: Canada
Registered: 2011-06-02
Posts: 4,769

Re: Thunar mounts USB drives with (false?) root permission

What I see is that I can't copy a previously selected file after the eject and remount commands. If I re-select the file and copy it, I can then paste it. Thunar 1.8.1 on Arch. Still probably a bug. I'll see if I can test this on an earlier version of thunar (1.6 series).


Board footer

Powered by FluxBB