diff options
author | Colin Walters <walters@verbum.org> | 2012-09-27 21:35:22 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2012-09-28 12:55:38 -0400 |
commit | c27c5004132e597a8f386be6f9e4235519096398 (patch) | |
tree | 17d33e41ee9ad22fc3b325d146dadfe4a2fdcffe | |
parent | 1a556443757b19fee67ef4441141246dd9cfed4f (diff) | |
download | dbus-c27c5004132e597a8f386be6f9e4235519096398.tar.gz dbus-c27c5004132e597a8f386be6f9e4235519096398.tar.bz2 dbus-c27c5004132e597a8f386be6f9e4235519096398.zip |
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); } |