pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/glib2 glib2: getfsent() is not thread-safe.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/dcdcbacfdf71
branches:  trunk
changeset: 458571:dcdcbacfdf71
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sat Sep 18 13:19:26 2021 +0000

description:
glib2: getfsent() is not thread-safe.

Add patch from FreeBSD ports, via Sergio Lenzi in PR 56408.

Bump PKGREVISION.

diffstat:

 devel/glib2/Makefile                        |   4 +-
 devel/glib2/distinfo                        |   4 +-
 devel/glib2/patches/patch-gio_gunixmounts.c |  50 +++++++++++++++++++++++++++-
 3 files changed, 52 insertions(+), 6 deletions(-)

diffs (99 lines):

diff -r a28d904497ea -r dcdcbacfdf71 devel/glib2/Makefile
--- a/devel/glib2/Makefile      Sat Sep 18 12:49:09 2021 +0000
+++ b/devel/glib2/Makefile      Sat Sep 18 13:19:26 2021 +0000
@@ -1,7 +1,9 @@
-# $NetBSD: Makefile,v 1.283 2021/09/13 07:14:50 adam Exp $
+# $NetBSD: Makefile,v 1.284 2021/09/18 13:19:26 wiz Exp $
 
 .include "Makefile.common"
 
+PKGREVISION=   1
+
 CATEGORIES=    devel gnome
 COMMENT=       Some useful routines for C programming (glib2)
 
diff -r a28d904497ea -r dcdcbacfdf71 devel/glib2/distinfo
--- a/devel/glib2/distinfo      Sat Sep 18 12:49:09 2021 +0000
+++ b/devel/glib2/distinfo      Sat Sep 18 13:19:26 2021 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.289 2021/09/13 07:14:50 adam Exp $
+$NetBSD: distinfo,v 1.290 2021/09/18 13:19:26 wiz Exp $
 
 SHA1 (glib-2.68.4.tar.xz) = bfebd4a5074715962177e8712cec630219f58786
 RMD160 (glib-2.68.4.tar.xz) = cf4d834a0e8f5e77ba39d627290ac0263ba0f177
@@ -10,7 +10,7 @@
 SHA1 (patch-gio_glib-compile-schemas.c) = 4fc8e8ba62bef01762007ebf21569053374808d0
 SHA1 (patch-gio_gresource-tool.c) = ad0e59f48f5f98ea66be568dbe2e5a5d1ac602fc
 SHA1 (patch-gio_gunixcredentialsmessage.c) = c13119ddd6262db7c03e53857e987f0c495d3312
-SHA1 (patch-gio_gunixmounts.c) = 13af07fffe898457edd0d8db4296a60fccba913d
+SHA1 (patch-gio_gunixmounts.c) = 6213fb2d4cb52af0ebbe794832e37dd3de9fd27f
 SHA1 (patch-gio_inotify_inotify-kernel.c) = 78544b4c32ef3b44e8721b1c07407f46a9e8c8a4
 SHA1 (patch-gio_meson.build) = c2bda4943f8580706ec45760604ed1bdf63d1c6f
 SHA1 (patch-gio_tests_gdbus-export.c) = 59d85ca079d02b52e33153c7d2ac1cc48c26707a
diff -r a28d904497ea -r dcdcbacfdf71 devel/glib2/patches/patch-gio_gunixmounts.c
--- a/devel/glib2/patches/patch-gio_gunixmounts.c       Sat Sep 18 12:49:09 2021 +0000
+++ b/devel/glib2/patches/patch-gio_gunixmounts.c       Sat Sep 18 13:19:26 2021 +0000
@@ -1,12 +1,17 @@
-$NetBSD: patch-gio_gunixmounts.c,v 1.5 2019/06/06 11:05:12 adam Exp $
+$NetBSD: patch-gio_gunixmounts.c,v 1.6 2021/09/18 13:19:26 wiz Exp $
 
 SunOS has sys/mntent.h but no mnt_opts.
 XXX who else uses the sys/mntent.h case?
 https://gitlab.gnome.org/GNOME/glib/merge_requests/890
 
---- gio/gunixmounts.c.orig     2019-05-03 13:43:28.000000000 +0000
+getfsent does not support multiple threads, so use lock around its
+use.
+https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250311
+https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1717
+
+--- gio/gunixmounts.c.orig     2021-08-19 15:27:25.722339900 +0000
 +++ gio/gunixmounts.c
-@@ -736,7 +736,7 @@ _g_get_unix_mounts (void)
+@@ -743,7 +743,7 @@ _g_get_unix_mounts (void)
                                               mntent.mnt_mountp,
                                               NULL,
                                               mntent.mnt_fstype,
@@ -15,3 +20,42 @@
                                               is_read_only);
  
        return_list = g_list_prepend (return_list, mount_entry);
+@@ -1406,6 +1406,8 @@ _g_get_unix_mount_points (void)
+ 
+ #elif (defined(HAVE_GETVFSSTAT) || defined(HAVE_GETFSSTAT)) && defined(HAVE_FSTAB_H) && defined(HAVE_SYS_MOUNT_H)
+ 
++G_LOCK_DEFINE_STATIC(getfsent);
++
+ static GList *
+ _g_get_unix_mount_points (void)
+ {
+@@ -1417,9 +1419,6 @@ _g_get_unix_mount_points (void)
+   struct stat sb;
+ #endif
+   
+-  if (!setfsent ())
+-    return NULL;
+-
+   return_list = NULL;
+   
+ #ifdef HAVE_SYS_SYSCTL_H
+@@ -1450,6 +1449,11 @@ _g_get_unix_mount_points (void)
+ #endif
+ #endif
+   
++  G_LOCK (getfsent);
++  if (!setfsent ()) {
++    G_UNLOCK (getfsent);
++    return NULL;
++  }
+   while ((fstab = getfsent ()) != NULL)
+     {
+       gboolean is_read_only = FALSE;
+@@ -1485,6 +1489,7 @@ _g_get_unix_mount_points (void)
+     }
+   
+   endfsent ();
++  G_UNLOCK (getfsent);
+   
+   return g_list_reverse (return_list);
+ }



Home | Main Index | Thread Index | Old Index