Xfce Forum

Sub domains
 

You are not logged in.

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

ArON
Member
Registered: 2018-11-06
Posts: 4

Thunar mounts USB drives with (false?) root permission

Hi,

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.
ddkAhOc.png

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?

Thanks!

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

Offline

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

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 4,832

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).

Offline

#3 2018-12-05 23:09:42

ArON
Member
Registered: 2018-11-06
Posts: 4

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

Thanks @ToZ. After reading your posts. I found out this:

a. insert the USB flash drive, copy a file into this USB drive, everything is fine.

b. eject it and then insert it again

c. Now right away I can't create a folder / file or delete a file on/from this USB drive by right click, as the menus are grayed. I can't drag and drop a file into this USB drive;

d. Then, if I copy a file elsewhere (i.e. not from this USB drive), then I'll be able to paste the file inside the USB drive, or create a file/folder, or delete a file from this USB drive.

What's odd is, in order for me to delete a file from the USB drive, I need to copy a file outside of the drive first.

P.S.
e. I have repeated the above for dozens of times, and sometimes I can't even have the same results, sometimes no matter what I do, I can't paste a file any more. So maybe a bug?

f. but this chaotic behaviour exists on 2 different Arch machines so at least this appears to be consistent.

Tested on Arch with Thunar 1.8.2 and 1.8.1.

Is this reproducible on your end? Thanks a lot!

Last edited by ArON (2018-12-05 23:11:18)

Offline

#4 2018-12-06 21:34:05

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 4,832

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

I haven't bee able to test this on 1.6x, but I can replicate the issue on 1.8.x. I think you should create a bug report.

Offline

#5 Today 16:39:46

texadactyl
Member
Registered: Today
Posts: 1

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

This anomaly was reported in 2014 as a Xubuntu report against Thunar 1.6.3: https://bugs.launchpad.net/ubuntu/+sour … ug/1332623
The behavior is the same today in Ubuntu 18.04.1.

Offline

Board footer

Powered by FluxBB