GNOME Bugzilla – Bug 598914
Attempts to automount internal partitions
Last modified: 2010-01-19 23:10:24 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.
Created attachment 145780 [details] [review] git formatted patch
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.
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