diff options
author | Colin Walters <walters@verbum.org> | 2012-09-27 21:35:22 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2012-09-28 10:18:15 -0400 |
commit | 4b351918b9f70eaedbdb3ab39208bc1f131efae0 (patch) | |
tree | f3c3f87d6965a19f0b0471ad6a030012b27afebf | |
parent | d839f027ed2cf320ac8b762ea93ba8af74ef50c6 (diff) | |
download | dbus-4b351918b9f70eaedbdb3ab39208bc1f131efae0.tar.gz |
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
-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 c9ec9e5b..c60457be 100644 --- a/dbus/dbus-sysdeps-pthread.c +++ b/dbus/dbus-sysdeps-pthread.c @@ -275,6 +275,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 (NULL); } |