[Midnightbsd-cvs] mports [22903] trunk/devel/glib20: glib 2.50.2

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Oct 7 11:51:08 EDT 2017


Revision: 22903
          http://svnweb.midnightbsd.org/mports/?rev=22903
Author:   laffer1
Date:     2017-10-07 11:51:08 -0400 (Sat, 07 Oct 2017)
Log Message:
-----------
glib 2.50.2

Modified Paths:
--------------
    trunk/devel/glib20/Makefile
    trunk/devel/glib20/distinfo

Added Paths:
-----------
    trunk/devel/glib20/files/patch-bug739424
    trunk/devel/glib20/files/patch-bug778515
    trunk/devel/glib20/files/patch-gio_glocalfileoutputstream.c

Removed Paths:
-------------
    trunk/devel/glib20/files/patch-gio_gunionvolumemonitor.c

Modified: trunk/devel/glib20/Makefile
===================================================================
--- trunk/devel/glib20/Makefile	2017-10-05 19:32:45 UTC (rev 22902)
+++ trunk/devel/glib20/Makefile	2017-10-07 15:51:08 UTC (rev 22903)
@@ -1,7 +1,7 @@
 # $MidnightBSD$
 
 PORTNAME=	glib
-PORTVERSION=	2.46.2
+PORTVERSION=	2.50.2
 PORTREVISION?=	0
 CATEGORIES=	devel
 MASTER_SITES=	GNOME
@@ -20,7 +20,8 @@
 		libffi.so:${PORTSDIR}/devel/libffi
 
 GNU_CONFIGURE=	yes
-USES+=		gettext gmake iconv:wchar_t libtool pathfix python pkgconfig shebangfix
+USES+=		compiler:c11 gettext gmake iconv:wchar_t libtool pathfix \
+		python pkgconfig shebangfix
 USE_PYTHON=	py3kplist
 USE_LDCONFIG=	yes
 USE_PERL5=	yes
@@ -35,9 +36,7 @@
 LDFLAGS+=	-L${LOCALBASE}/lib
 INSTALL_TARGET=	install-strip
 
-SHEBANG_FILES=	*/*.pl
-
-LIBVERSION=	0.4600.2
+LIBVERSION=	0.5000.2
 PLIST_SUB+=	LIBVERSION=${LIBVERSION}
 
 glib_MAN=	gtester.1 gtester-report.1 glib-gettextize.1

Modified: trunk/devel/glib20/distinfo
===================================================================
--- trunk/devel/glib20/distinfo	2017-10-05 19:32:45 UTC (rev 22902)
+++ trunk/devel/glib20/distinfo	2017-10-07 15:51:08 UTC (rev 22903)
@@ -1,2 +1,3 @@
-SHA256 (gnome2/glib-2.46.2.tar.xz) = 5031722e37036719c1a09163cc6cf7c326e4c4f1f1e074b433c156862bd733db
-SIZE (gnome2/glib-2.46.2.tar.xz) = 7344636
+TIMESTAMP = 1507391225
+SHA256 (gnome2/glib-2.50.2.tar.xz) = be68737c1f268c05493e503b3b654d2b7f43d7d0b8c5556f7e4651b870acfbf5
+SIZE (gnome2/glib-2.50.2.tar.xz) = 7582312

Added: trunk/devel/glib20/files/patch-bug739424
===================================================================
--- trunk/devel/glib20/files/patch-bug739424	                        (rev 0)
+++ trunk/devel/glib20/files/patch-bug739424	2017-10-07 15:51:08 UTC (rev 22903)
@@ -0,0 +1,59 @@
+From 22656f16c29591207c667362e2a42fd348fe8494 Mon Sep 17 00:00:00 2001
+From: Martin Pieuchot <mpi at openbsd.org>
+Date: Fri, 28 Apr 2017 15:06:52 +0200
+Subject: [PATCH] kqueue: fix use-after-free of ``kqueue_sub''.
+
+Since ``kqueue_sub'' are not refcounted it is common to see a thread
+freeing one of them while another thread is manipulating them.  This
+leads to crashs reported in:
+	https://bugzilla.gnome.org/show_bug.cgi?id=739424
+
+To prevent such crash, make sure the threads are holding ``hash_lock''
+when manipulating such items.
+---
+ gio/kqueue/kqueue-helper.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/gio/kqueue/kqueue-helper.c b/gio/kqueue/kqueue-helper.c
+index d4e66cd4d..84b9ef164 100644
+--- gio/kqueue/kqueue-helper.c
++++ gio/kqueue/kqueue-helper.c
+@@ -291,10 +291,10 @@ process_kqueue_notifications (GIOChannel   *gioc,
+ 
+   G_LOCK (hash_lock);
+   sub = (kqueue_sub *) g_hash_table_lookup (subs_hash_table, GINT_TO_POINTER (n.fd));
+-  G_UNLOCK (hash_lock);
+ 
+   if (sub == NULL)
+     {
++      G_UNLOCK (hash_lock);
+       KH_W ("Got a notification for a deleted or non-existing subscription %d",
+              n.fd);
+       return TRUE;
+@@ -336,6 +336,7 @@ process_kqueue_notifications (GIOChannel   *gioc,
+         g_file_monitor_source_handle_event (source, mask, NULL, NULL, NULL, g_get_monotonic_time ());
+     }
+ 
++  G_UNLOCK (hash_lock);
+   return TRUE;
+ }
+ 
+@@ -451,13 +452,14 @@ _kh_start_watching (kqueue_sub *sub)
+ 
+   G_LOCK (hash_lock);
+   g_hash_table_insert (subs_hash_table, GINT_TO_POINTER (sub->fd), sub);
+-  G_UNLOCK (hash_lock);
+ 
+   _kqueue_thread_push_fd (sub->fd);
+   
+   /* Bump the kqueue thread. It will pick up a new sub entry to monitor */
+   if (!_ku_write (kqueue_socket_pair[0], "A", 1))
+     KH_W ("Failed to bump the kqueue thread (add fd, error %d)", errno);
++  G_UNLOCK (hash_lock);
++
+   return TRUE;
+ }
+ 
+-- 
+2.12.2
+


Property changes on: trunk/devel/glib20/files/patch-bug739424
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/devel/glib20/files/patch-bug778515
===================================================================
--- trunk/devel/glib20/files/patch-bug778515	                        (rev 0)
+++ trunk/devel/glib20/files/patch-bug778515	2017-10-07 15:51:08 UTC (rev 22903)
@@ -0,0 +1,55 @@
+From e305fe971e4647d971428a772b7290b9c308a96f Mon Sep 17 00:00:00 2001
+From: Steven McDonald <steven at steven-mcdonald.id.au>
+Date: Sun, 12 Feb 2017 11:02:55 +1100
+Subject: gio: Always purge kqueue subs from missing list
+
+Previously, _kh_cancel_sub assumed that it only needed to call
+_km_remove if sub did not exist in subs_hash_table. This is erroneous
+because the complementary operation, _km_add_missing, can be called
+from process_kqueue_notifications, in which context sub can *only* have
+come from subs_hash_table.
+
+Since _km_remove is implemented using g_slist_remove, which is
+documented to be a noop if the list does not contain the element to be
+removed, it is safe to call _km_remove unconditionally here.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=778515
+---
+ gio/kqueue/kqueue-helper.c | 15 +++++----------
+ 1 file changed, 5 insertions(+), 10 deletions(-)
+
+diff --git a/gio/kqueue/kqueue-helper.c b/gio/kqueue/kqueue-helper.c
+index 4671396..d4e66cd 100644
+--- gio/kqueue/kqueue-helper.c
++++ gio/kqueue/kqueue-helper.c
+@@ -498,22 +498,17 @@ _kh_add_sub (kqueue_sub *sub)
+ gboolean
+ _kh_cancel_sub (kqueue_sub *sub)
+ {
+-  gboolean missing = FALSE;
++  gboolean removed = FALSE;
+   g_assert (kqueue_socket_pair[0] != -1);
+   g_assert (sub != NULL);
+ 
++  _km_remove (sub);
++
+   G_LOCK (hash_lock);
+-  missing = !g_hash_table_remove (subs_hash_table, GINT_TO_POINTER (sub->fd));
++  removed = g_hash_table_remove (subs_hash_table, GINT_TO_POINTER (sub->fd));
+   G_UNLOCK (hash_lock);
+ 
+-  if (missing)
+-    {
+-      /* If there were no fd for this subscription, file is still
+-       * missing. */
+-      KH_W ("Removing subscription from missing");
+-      _km_remove (sub);
+-    }
+-  else
++  if (removed)
+     {
+       /* fd will be closed in the kqueue thread */
+       _kqueue_thread_remove_fd (sub->fd);
+-- 
+cgit v0.12
+


Property changes on: trunk/devel/glib20/files/patch-bug778515
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/devel/glib20/files/patch-gio_glocalfileoutputstream.c
===================================================================
--- trunk/devel/glib20/files/patch-gio_glocalfileoutputstream.c	                        (rev 0)
+++ trunk/devel/glib20/files/patch-gio_glocalfileoutputstream.c	2017-10-07 15:51:08 UTC (rev 22903)
@@ -0,0 +1,38 @@
+From 45d4b59e3f7ef7b41db08f0c11ee5000126cfedb Mon Sep 17 00:00:00 2001
+From: Ting-Wei Lan <lantw at src.gnome.org>
+Date: Sun, 4 Dec 2016 15:02:54 +0800
+Subject: [PATCH] glocalfileoutputstream: Fix symlink writing on FreeBSD and
+ NetBSD
+
+FreeBSD, DragonflyBSD and NetBSD support O_NOFOLLOW, but they use error
+numbers that are different from what POSIX standard specifies. They are
+not going to change the behavior, and existing programs on these systems
+already take advantage of this difference. To support them, we have to
+add a check in GIO to use different error numbers on these systems.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=775593
+---
+ gio/glocalfileoutputstream.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/gio/glocalfileoutputstream.c b/gio/glocalfileoutputstream.c
+index 81184a671..4b3733cce 100644
+--- gio/glocalfileoutputstream.c
++++ gio/glocalfileoutputstream.c
+@@ -763,7 +763,13 @@ handle_overwrite_open (const char    *filename,
+ #ifdef O_NOFOLLOW
+   is_symlink = FALSE;
+   fd = g_open (filename, open_flags | O_NOFOLLOW, mode);
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
++  if (fd == -1 && errno == EMLINK)
++#elif defined(__NetBSD__)
++  if (fd == -1 && errno == EFTYPE)
++#else
+   if (fd == -1 && errno == ELOOP)
++#endif
+     {
+       /* Could be a symlink, or it could be a regular ELOOP error,
+        * but then the next open will fail too. */
+-- 
+2.13.0
+


Property changes on: trunk/devel/glib20/files/patch-gio_glocalfileoutputstream.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Deleted: trunk/devel/glib20/files/patch-gio_gunionvolumemonitor.c
===================================================================
--- trunk/devel/glib20/files/patch-gio_gunionvolumemonitor.c	2017-10-05 19:32:45 UTC (rev 22902)
+++ trunk/devel/glib20/files/patch-gio_gunionvolumemonitor.c	2017-10-07 15:51:08 UTC (rev 22903)
@@ -1,16 +0,0 @@
-https://bugzilla.gnome.org/show_bug.cgi?id=753378
-
---- gio/gunionvolumemonitor.c.orig	2015-09-25 11:23:00.429587000 +0200
-+++ gio/gunionvolumemonitor.c	2015-09-25 11:23:12.787618000 +0200
-@@ -592,9 +592,9 @@ _g_mount_get_for_mount_path (const gchar
- 
-   if (klass->get_mount_for_mount_path)
-     {
--      g_rec_mutex_lock (&the_volume_monitor_mutex);
-+//      g_rec_mutex_lock (&the_volume_monitor_mutex);
-       mount = klass->get_mount_for_mount_path (mount_path, cancellable);
--      g_rec_mutex_unlock (&the_volume_monitor_mutex);
-+//      g_rec_mutex_unlock (&the_volume_monitor_mutex);
-     }
- 
-   /* TODO: How do we know this succeeded? Keep in mind that the native



More information about the Midnightbsd-cvs mailing list