From 8ad179a8dad789fc6a5402780044bc0ec3d41115 Mon Sep 17 00:00:00 2001 From: Alban Crequy Date: Fri, 4 Jul 2014 15:05:51 +0100 Subject: Stop listening on DBusServer sockets when reaching max_incomplete_connections This addresses the parts of CVE-2014-3639 not already addressed by reducing the default authentication timeout. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80851 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80919 Reviewed-by: Simon McVittie --- dbus/dbus-watch.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'dbus/dbus-watch.c') diff --git a/dbus/dbus-watch.c b/dbus/dbus-watch.c index b82c57d4..76a5d641 100644 --- a/dbus/dbus-watch.c +++ b/dbus/dbus-watch.c @@ -454,6 +454,27 @@ _dbus_watch_list_toggle_watch (DBusWatchList *watch_list, } } +/** + * Sets all watches to the given enabled state, invoking the + * application's DBusWatchToggledFunction if appropriate. + * + * @param watch_list the watch list. + * @param enabled #TRUE to enable + */ +void +_dbus_watch_list_toggle_all_watches (DBusWatchList *watch_list, + dbus_bool_t enabled) +{ + DBusList *link; + + for (link = _dbus_list_get_first_link (&watch_list->watches); + link != NULL; + link = _dbus_list_get_next_link (&watch_list->watches, link)) + { + _dbus_watch_list_toggle_watch (watch_list, link->data, enabled); + } +} + /** * Sets the handler for the watch. * -- cgit v1.2.1