glib r7786 - branches/glib-2-18/gio
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: glib r7786 - branches/glib-2-18/gio
- Date: Fri, 9 Jan 2009 05:43:55 +0000 (UTC)
Author: matthiasc
Date: Fri Jan 9 05:43:55 2009
New Revision: 7786
URL: http://svn.gnome.org/viewvc/glib?rev=7786&view=rev
Log:
gunixmounts.c: Use g_access() to check accessibility of local devices.
Patch by Martin Pitt
Modified:
branches/glib-2-18/gio/ChangeLog
branches/glib-2-18/gio/gunixmounts.c
Modified: branches/glib-2-18/gio/gunixmounts.c
==============================================================================
--- branches/glib-2-18/gio/gunixmounts.c (original)
+++ branches/glib-2-18/gio/gunixmounts.c Fri Jan 9 05:43:55 2009
@@ -1882,7 +1882,8 @@
/* 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/"))
@@ -1893,6 +1894,15 @@
}
}
g_free (path);
+
+ if (mount_entry->device_path && mount_entry->device_path[0] == '/')
+ {
+ 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;
+ }
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]