Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Oct 2020 17:16:15 +0000
From:      bugzilla-noreply@freebsd.org
To:        xfce@FreeBSD.org
Subject:   [Bug 250311] devel/glib20: lock getfsent() usage to fix x11-fm/thunar crashes
Message-ID:  <bug-250311-28711-o0h3DcWwIv@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-250311-28711@https.bugs.freebsd.org/bugzilla/>
References:  <bug-250311-28711@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D250311

--- Comment #3 from sigsys@gmail.com ---
(In reply to Tijl Coosemans from comment #2)
Oops you're right.

Better to move the call down while at it? No need to protect the sysctls.

--- gio/gunixmounts.c.orig      2020-10-01 09:17:53.138733000 -0400
+++ gio/gunixmounts.c   2020-10-15 13:05:40.628175000 -0400
@@ -1389,6 +1389,8 @@

 #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)
 {
@@ -1400,9 +1402,6 @@
   struct stat sb;
 #endif

-  if (!setfsent ())
-    return NULL;
-
   return_list =3D NULL;

 #ifdef HAVE_SYS_SYSCTL_H
@@ -1433,6 +1432,11 @@
 #endif
 #endif

+  G_LOCK (getfsent);
+  if (!setfsent ()) {
+    G_UNLOCK (getfsent);
+    return NULL;
+  }
   while ((fstab =3D getfsent ()) !=3D NULL)
     {
       gboolean is_read_only =3D FALSE;
@@ -1468,6 +1472,7 @@
     }

   endfsent ();
+  G_UNLOCK (getfsent);

   return g_list_reverse (return_list);
 }

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-250311-28711-o0h3DcWwIv>