# Description: Do not show /media mounts which are inaccessible to the user. This only works on local block devices, though, since others (like remote mounts) have the risk of hanging on stat().
# Ubuntu: https://launchpad.net/bug/210379
# Upstream: http://bugzilla.gnome.org/show_bug.cgi?id=526320
--- old/gio/gunixmounts.c	2008-10-16 16:31:48.000000000 +0200
+++ new/gio/gunixmounts.c	2008-11-28 13:24:59.000000000 +0100
@@ -1878,21 +1886,20 @@
   if (mount_path != NULL)
     {
       if (g_str_has_prefix (mount_path, "/media/")) {
-        char *path;
         /* Avoid displaying mounts that are not accessible to the user.
          *
          * See http://bugzilla.gnome.org/show_bug.cgi?id=526320 for why we
-         * want to avoid g_access() for every mount point.
+         * want to avoid g_access() for mount points which can potentially
+         * block or fail stat()'ing, such as network mounts.
          */
-        path = g_path_get_dirname (mount_path);
-        if (g_str_has_prefix (path, "/media/"))
+        if (mount_entry->device_path && mount_entry->device_path[0] == '/')
           {
-            if (g_access (path, R_OK|X_OK) != 0) {
-              g_free (path);
+            struct stat st;
+            if (g_stat (mount_entry->device_path, &st) == 0 &&
+                S_ISBLK(st.st_mode) &&
+                g_access (mount_path, R_OK|X_OK) != 0)
               return FALSE;
-            }
           }
-        g_free (path);
         return TRUE;
       }
       
