diff options
author | Colin Walters <walters@verbum.org> | 2012-09-27 21:35:22 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2012-09-28 16:19:39 -0400 |
commit | f2c505f24f46d316df9ba5022c17062b9bd7939b (patch) | |
tree | 0696fa98d4becc9651c03afa9564267b8b1a2887 | |
parent | 9cdf87a998329e06a1ffc401829b4f01b10d2861 (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
-rw-r--r-- | dbus/dbus-sysdeps-pthread.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/dbus/dbus-sysdeps-pthread.c b/dbus/dbus-sysdeps-pthread.c index 70737512..6e5d209e 100644 --- a/dbus/dbus-sysdeps-pthread.c +++ b/dbus/dbus-sysdeps-pthread.c @@ -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); } |