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 598914 - Attempts to automount internal partitions
Attempts to automount internal partitions
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: [obsolete] gdu volume monitor
1.4.x
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2009-10-19 11:33 UTC by Martin Pitt
Modified: 2010-01-19 23:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
git formatted patch (2.02 KB, patch)
2009-10-19 11:39 UTC, Martin Pitt
none Details | Review

Description Martin Pitt 2009-10-19 11:33:52 UTC
On a live system, where the user does not have a password, internal partitions often get automounted. This is not quite desirable, since a live system isn't supposed to modify your system (at least not automatically).

This is because gdu monitor's update_volume() sets automount flag to TRUE in general. However, it is set to FALSE if the media detection time is older than the "new volume" detection by 5 seconds or more. Thus if dk-disks was already running, starting gvfs will usually set automount to FALSE since the difference will be more than 5 seconds. The rationale is:

      /* If a volume (partition) appear _much later_ than when media was insertion it
       * can only be because the media was repartitioned. We don't want to automount
       * such volumes.
       */

But if gvfs-gdu-volume-monitor triggers dk-disks startup (which is the case at first login usually, or when starting a live system), the "last media detection" time will be almost equal to "new volume", and automount will be TRUE.

I think we should generally disable automounting for system internal drives. It will fix this live system case. For real installed systems it should not actually change behaviour, since internal drives require polkit authorization, and all drives which do are not automounted at nautilus startup anyway.
Comment 1 Martin Pitt 2009-10-19 11:39:44 UTC
Created attachment 145780 [details] [review]
git formatted patch
Comment 2 Martin Pitt 2009-10-19 11:53:20 UTC
Reproducer for easy testing:

Working case:

$ devkit-disks --dump # ensure that dk-d runs
... wait 5 seconds
$ kill `ps ux|grep gvfs | grep -v grep | awk '{print $2}'`
$ gvfs-mount -li
  Volume(0): test
  [...]
     unix-device: '/dev/sda3'
    should_automount=0
  [...]

Case which simulates session startup:

$ sudo killall devkit-disks-daemon
$ kill `ps ux|grep gvfs | grep -v grep | awk '{print $2}'`
$ gvfs-mount -li
  Volume(0): test
  [...]
     unix-device: '/dev/sda3'
    should_automount=1
  [...]

This will cause a polkit dialog for mounting.
Comment 3 Martin Pitt 2010-01-19 23:10:24 UTC
The patch does not apply any more, but it looks like this was fixed as a by-product of

http://git.gnome.org/browse/gvfs/commit/?id=a342316cb7b9d236ff3063d7b24b7b04c61a379e