summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2018-04-26 13:37:01 +0200
committerOndrej Holy <oholy@redhat.com>2018-05-23 10:38:07 +0200
commit959db3e0d89947bca27c5e820314effca6e818aa (patch)
tree557b8123f60a40df8e5e57cd657c560d08119b5d
parent7195df960998a840868bbcbd9fc7e904cb5bf198 (diff)
downloadgvfs-959db3e0d89947bca27c5e820314effca6e818aa.tar.gz
udisks2: Handle x-gvfs- options not only for fstab entries
GVfsUDisks2VolumeMonitor handles x-gvfs-hide/x-gvfs-show mount options used to overwrite our heuristics whether the mount should be shown, or hidden. Unfortunately, it works currently only for mounts with corresponding fstab entries, because the options are read over g_unix_mount_point_get_options. Let's use the newly introduced g_unix_mount_get_options to allow reading of the options for all sort of mounts (e.g. created over pam_mount, or manually mounted). Update GLib dependency accordingly. https://bugzilla.gnome.org/show_bug.cgi?id=795578
-rw-r--r--meson.build2
-rw-r--r--monitor/udisks2/gvfsudisks2volumemonitor.c16
2 files changed, 14 insertions, 4 deletions
diff --git a/meson.build b/meson.build
index 9e831744..f171ea56 100644
--- a/meson.build
+++ b/meson.build
@@ -224,7 +224,7 @@ have_version_script = host_machine.system().contains('linux') and cc.has_argumen
gio_dep = dependency('gio-2.0')
gio_unix_dep = dependency('gio-unix-2.0')
-glib_dep = dependency('glib-2.0', version: '>= 2.51.0')
+glib_dep = dependency('glib-2.0', version: '>= 2.57.1')
gobject_dep = dependency('gobject-2.0')
# *** Check for libXML ***
diff --git a/monitor/udisks2/gvfsudisks2volumemonitor.c b/monitor/udisks2/gvfsudisks2volumemonitor.c
index aab30c34..e1d67fb8 100644
--- a/monitor/udisks2/gvfsudisks2volumemonitor.c
+++ b/monitor/udisks2/gvfsudisks2volumemonitor.c
@@ -698,8 +698,20 @@ should_include_mount (GVfsUDisks2VolumeMonitor *monitor,
GUnixMountEntry *mount_entry)
{
GUnixMountPoint *mount_point;
+ const gchar *options;
gboolean ret;
+ /* g_unix_mount_get_options works only with libmount,
+ * see https://bugzilla.gnome.org/show_bug.cgi?id=668132
+ */
+ options = g_unix_mount_get_options (mount_entry);
+ if (options != NULL)
+ {
+ ret = should_include (g_unix_mount_get_mount_path (mount_entry),
+ options);
+ goto out;
+ }
+
/* if mounted at the designated mount point, use that info to decide */
mount_point = get_mount_point_for_mount (mount_entry);
if (mount_point != NULL)
@@ -709,9 +721,7 @@ should_include_mount (GVfsUDisks2VolumeMonitor *monitor,
goto out;
}
- /* otherwise, use the mount's info */
- ret = should_include (g_unix_mount_get_mount_path (mount_entry),
- NULL); /* no mount options yet - see bug 668132 */
+ ret = should_include (g_unix_mount_get_mount_path (mount_entry), NULL);
out:
return ret;