diff options
author | marcus <marcus@FreeBSD.org> | 2005-03-20 08:11:43 +0800 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2005-03-20 08:11:43 +0800 |
commit | 633b0b4bc62138bc1c5e478aa7c459c2f865092d (patch) | |
tree | 6bd28051f105888b3976f303355339f4c254e754 /devel | |
parent | 1401c5dfdb03633c6584af071431ad0be2a0bece (diff) | |
download | freebsd-ports-graphics-633b0b4bc62138bc1c5e478aa7c459c2f865092d.tar.gz freebsd-ports-graphics-633b0b4bc62138bc1c5e478aa7c459c2f865092d.tar.zst freebsd-ports-graphics-633b0b4bc62138bc1c5e478aa7c459c2f865092d.zip |
Protect more calls to xdg_mime* functions with mime_mutex to avoid
re-entrancy crashes.
Diffstat (limited to 'devel')
-rw-r--r-- | devel/gnome-vfs/Makefile | 1 | ||||
-rw-r--r-- | devel/gnome-vfs/files/patch-libgnomevfs_gnome-vfs-mime.c | 38 | ||||
-rw-r--r-- | devel/gnomevfs2/Makefile | 1 | ||||
-rw-r--r-- | devel/gnomevfs2/files/patch-libgnomevfs_gnome-vfs-mime.c | 38 |
4 files changed, 78 insertions, 0 deletions
diff --git a/devel/gnome-vfs/Makefile b/devel/gnome-vfs/Makefile index d5535b85750..60136a8089f 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 00000000000..69815012520 --- /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; diff --git a/devel/gnomevfs2/Makefile b/devel/gnomevfs2/Makefile index d5535b85750..60136a8089f 100644 --- a/devel/gnomevfs2/Makefile +++ b/devel/gnomevfs2/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/gnomevfs2/files/patch-libgnomevfs_gnome-vfs-mime.c b/devel/gnomevfs2/files/patch-libgnomevfs_gnome-vfs-mime.c new file mode 100644 index 00000000000..69815012520 --- /dev/null +++ b/devel/gnomevfs2/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; |