diff options
author | Joe Marcus Clarke <marcus@FreeBSD.org> | 2005-03-20 00:11:43 +0000 |
---|---|---|
committer | Joe Marcus Clarke <marcus@FreeBSD.org> | 2005-03-20 00:11:43 +0000 |
commit | e32963fa067deee18d212b4507430893e98bc5e1 (patch) | |
tree | 5ee25379de7cf064c90940205f0fdaf9d92d1446 /devel/gnome-vfs | |
parent | - Fix plist (diff) |
Protect more calls to xdg_mime* functions with mime_mutex to avoid
re-entrancy crashes.
Notes
Notes:
svn path=/head/; revision=131676
Diffstat (limited to 'devel/gnome-vfs')
-rw-r--r-- | devel/gnome-vfs/Makefile | 1 | ||||
-rw-r--r-- | devel/gnome-vfs/files/patch-libgnomevfs_gnome-vfs-mime.c | 38 |
2 files changed, 39 insertions, 0 deletions
diff --git a/devel/gnome-vfs/Makefile b/devel/gnome-vfs/Makefile index d5535b85750e..60136a8089f2 100644 --- a/devel/gnome-vfs/Makefile +++ b/devel/gnome-vfs/Makefile @@ -7,6 +7,7 @@ PORTNAME= gnomevfs2 PORTVERSION= 2.10.0 +PORTREVISION= 1 CATEGORIES= devel gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= sources/gnome-vfs/2.10 diff --git a/devel/gnome-vfs/files/patch-libgnomevfs_gnome-vfs-mime.c b/devel/gnome-vfs/files/patch-libgnomevfs_gnome-vfs-mime.c new file mode 100644 index 000000000000..698150125205 --- /dev/null +++ b/devel/gnome-vfs/files/patch-libgnomevfs_gnome-vfs-mime.c @@ -0,0 +1,38 @@ +--- libgnomevfs/gnome-vfs-mime.c.orig Sat Mar 19 18:59:45 2005 ++++ libgnomevfs/gnome-vfs-mime.c Sat Mar 19 19:02:24 2005 +@@ -167,7 +167,9 @@ + GnomeVFSResult result = GNOME_VFS_OK; + const char *mime_type; + ++ G_LOCK (mime_mutex); + max_extents = xdg_mime_get_max_buffer_extents (); ++ G_UNLOCK (mime_mutex); + max_extents = CLAMP (max_extents, 0, MAX_SNIFF_BUFFER_ALLOWED); + + if (!buffer->read_whole_file) { +@@ -592,7 +594,9 @@ + g_return_val_if_fail (a != NULL, FALSE); + g_return_val_if_fail (b != NULL, FALSE); + ++ G_LOCK (mime_mutex); + xdg_mime_mime_type_equal (a, b); ++ G_UNLOCK (mime_mutex); + + return FALSE; + } +@@ -626,8 +630,13 @@ + + if (gnome_vfs_mime_type_is_equal (mime_type, base_mime_type)) { + return GNOME_VFS_MIME_IDENTICAL; +- } else if (xdg_mime_mime_type_subclass (mime_type, base_mime_type)) { +- return GNOME_VFS_MIME_PARENT; ++ } else { ++ G_LOCK (mime_mutex); ++ if (xdg_mime_mime_type_subclass (mime_type, base_mime_type)) { ++ G_UNLOCK (mime_mutex); ++ return GNOME_VFS_MIME_PARENT; ++ } ++ G_UNLOCK (mime_mutex); + } + + return GNOME_VFS_MIME_UNRELATED; |