]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
hardening: Ensure _dbus_check_setuid() is initialized threadsafe manner
authorColin Walters <walters@verbum.org>
Fri, 28 Sep 2012 01:35:22 +0000 (21:35 -0400)
committerColin Walters <walters@verbum.org>
Fri, 28 Sep 2012 20:19:39 +0000 (16:19 -0400)
This is a highly theoretical concern, but we might as well.

https://bugs.freedesktop.org/show_bug.cgi?id=52202

Conflicts:
dbus/dbus-sysdeps-pthread.c

dbus/dbus-sysdeps-pthread.c

index 70737512e8f8364aad36a955fb1f9f1126b9c3c6..6e5d209ec11be6122e93e273d5f133ebf6869b23 100644 (file)
@@ -359,6 +359,11 @@ check_monotonic_clock (void)
 dbus_bool_t
 _dbus_threads_init_platform_specific (void)
 {
+  /* These have static variables, and we need to handle both the case
+   * where dbus_threads_init() has been called and when it hasn't;
+   * so initialize them before any threads are allowed to enter.
+   */
   check_monotonic_clock ();
+  (void) _dbus_check_setuid ();
   return dbus_threads_init (&pthread_functions);
 }