[gvfs] udisks2: Only show $XDG_RUNTIME_DIR mounts if they are in media dir



commit 60968576962f10212caf9e59a41ef0a9f77e6165
Author: David Zeuthen <davidz redhat com>
Date:   Sat Feb 18 12:56:25 2012 -0500

    udisks2: Only show $XDG_RUNTIME_DIR mounts if they are in media dir
    
    Signed-off-by: David Zeuthen <davidz redhat com>

 monitor/udisks2/gvfsudisks2volumemonitor.c |    3 ++-
 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 dfb4251..ae3711c 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 4013cf0..409ecf0 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]