diff options
author | David Zeuthen <davidz@redhat.com> | 2012-02-18 12:56:25 -0500 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2012-02-18 12:56:25 -0500 |
commit | 60968576962f10212caf9e59a41ef0a9f77e6165 (patch) | |
tree | 6252f1488046f11cb70a7f712871d06611eccd36 | |
parent | 184ecff8482c06ea59c7b0a176b890acc3fa8083 (diff) | |
download | gvfs-60968576962f10212caf9e59a41ef0a9f77e6165.tar.gz |
udisks2: Only show $XDG_RUNTIME_DIR mounts if they are in media dir
Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r-- | monitor/udisks2/gvfsudisks2volumemonitor.c | 3 | ||||
-rw-r--r-- | monitor/udisks2/what-is-shown.txt | 11 |
2 files changed, 8 insertions, 6 deletions
diff --git a/monitor/udisks2/gvfsudisks2volumemonitor.c b/monitor/udisks2/gvfsudisks2volumemonitor.c index dfb42519..ae3711cb 100644 --- a/monitor/udisks2/gvfsudisks2volumemonitor.c +++ b/monitor/udisks2/gvfsudisks2volumemonitor.c @@ -663,7 +663,8 @@ should_include (const gchar *mount_path, if (g_getenv ("XDG_RUNTIME_DIR") != NULL) { const gchar *run_dir = g_get_user_runtime_dir (); - if (g_str_has_prefix (mount_path, run_dir) && mount_path[strlen (run_dir)] == G_DIR_SEPARATOR) + if (g_str_has_prefix (mount_path, run_dir) && + strncmp ("/media/", mount_path + strlen (run_dir), sizeof ("/media/") - 1) == 0) { ret = TRUE; goto out; diff --git a/monitor/udisks2/what-is-shown.txt b/monitor/udisks2/what-is-shown.txt index 4013cf0f..409ecf04 100644 --- a/monitor/udisks2/what-is-shown.txt +++ b/monitor/udisks2/what-is-shown.txt @@ -20,11 +20,12 @@ with, or if not mounted, the options from its /etc/fstab entry, if any. If the directory for a device is known and outside /media, $HOME -(typically /home/foo) or $XDG_RUNTIME_DIR (typically /run/user/foo) -then the device is not shown in the user interface. Additionally, if -any of component directories in its directory starts with a dot ("."), -the device is not shown either. This policy may be overriden by use of -the options x-gvfs-show and x-gvfs-hide. +(typically /home/foo) or $XDG_RUNTIME_DIR/media (typically +/run/user/foo/media) then the device is not shown in the user +interface. Additionally, if any of component directories in its +directory starts with a dot ("."), the device is not shown +either. This policy may be overriden by use of the options x-gvfs-show +and x-gvfs-hide. The name and icon to use for a device is chosen according to certain heuristics - for example, if a device has a filesystem label, it is |