diff options
author | Ondrej Holy <oholy@redhat.com> | 2018-04-26 13:37:01 +0200 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2018-05-23 10:38:07 +0200 |
commit | 959db3e0d89947bca27c5e820314effca6e818aa (patch) | |
tree | 557b8123f60a40df8e5e57cd657c560d08119b5d /monitor | |
parent | 7195df960998a840868bbcbd9fc7e904cb5bf198 (diff) | |
download | gvfs-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
Diffstat (limited to 'monitor')
-rw-r--r-- | monitor/udisks2/gvfsudisks2volumemonitor.c | 16 |
1 files changed, 13 insertions, 3 deletions
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; |