summaryrefslogtreecommitdiff
path: root/dbus
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2012-09-27 21:35:22 -0400
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-10-02 09:21:23 +0100
commitf7b2ec1b2e39318766938b53511311a0d0a71680 (patch)
treefcce5cd845c91ff55df328d7dfbbf55ca53b6690 /dbus
parent083ebe6126a769491c8ef61f8998117440b48861 (diff)
hardening: Ensure _dbus_check_setuid() is initialized threadsafe manner
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
Diffstat (limited to 'dbus')
-rw-r--r--dbus/dbus-sysdeps-pthread.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/dbus/dbus-sysdeps-pthread.c b/dbus/dbus-sysdeps-pthread.c
index 46e4204d..f21af852 100644
--- a/dbus/dbus-sysdeps-pthread.c
+++ b/dbus/dbus-sysdeps-pthread.c
@@ -358,6 +358,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);
}