summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2016-08-16 16:12:35 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2016-11-28 18:23:57 +0000
commit8551c68d962cb821fa9514db9e3f86f7ffa27c6d (patch)
treee60d33972037dd51302d0121613838189688247f
parentc4640c6facdb48f98761188645212d9a9184e366 (diff)
downloaddbus-8551c68d962cb821fa9514db9e3f86f7ffa27c6d.tar.gz
Log to syslog when pending_fd_timeout is exceeded
This is either a denial-of-service attempt, a pathological performance problem or a dbus-daemon bug. Sysadmins should be told about any of these. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=86442 [smcv: add units to timeout: it is in milliseconds] Signed-off-by: Simon McVittie <smcv@debian.org> (cherry picked from commit 05cb619f0a6a4c9997832cb4acbb26f7a0be66c3)
-rw-r--r--bus/connection.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/bus/connection.c b/bus/connection.c
index 95e20a6e..a1976768 100644
--- a/bus/connection.c
+++ b/bus/connection.c
@@ -671,6 +671,18 @@ static dbus_bool_t
pending_unix_fds_timeout_cb (void *data)
{
DBusConnection *connection = data;
+ BusConnectionData *d = BUS_CONNECTION_DATA (connection);
+ int limit;
+
+ _dbus_assert (d != NULL);
+ limit = bus_context_get_pending_fd_timeout (d->connections->context);
+ bus_context_log (d->connections->context, DBUS_SYSTEM_LOG_WARNING,
+ "Connection \"%s\" (%s) has had Unix fds pending for too long, "
+ "closing it (pending_fd_timeout=%d ms)",
+ d->name != NULL ? d->name : "(null)",
+ bus_connection_get_loginfo (connection),
+ limit);
+
dbus_connection_close (connection);
return TRUE;
}