summaryrefslogtreecommitdiff
path: root/dbus/dbus-transport.c
diff options
context:
space:
mode:
authorAlban Crequy <alban.crequy@collabora.co.uk>2014-07-18 17:28:32 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-09-15 12:30:30 +0100
commit8021fd84267ee1394d96f4a119adb57de3971a62 (patch)
tree06992c03cc5d687e33522cd92da5d4adab10eba6 /dbus/dbus-transport.c
parent995734750cea65012537748ee56488c707d2f027 (diff)
downloaddbus-8021fd84267ee1394d96f4a119adb57de3971a62.tar.gz
DBusConnection: implements _dbus_connection_set_pending_fds_function
This is one of four commits needed to address CVE-2014-3637. This will allow the bus to be notified whenever a file descriptor is added or removed from a DBusConnection's DBusMessageLoader. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=80559 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'dbus/dbus-transport.c')
-rw-r--r--dbus/dbus-transport.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/dbus/dbus-transport.c b/dbus/dbus-transport.c
index 690e5ba8..f63e0ced 100644
--- a/dbus/dbus-transport.c
+++ b/dbus/dbus-transport.c
@@ -1523,6 +1523,22 @@ _dbus_transport_get_pending_fds_count (DBusTransport *transport)
return _dbus_message_loader_get_pending_fds_count (transport->loader);
}
+/**
+ * Register a function to be called whenever the number of pending file
+ * descriptors in the loader change.
+ *
+ * @param transport the transport
+ * @param callback the callback
+ */
+void
+_dbus_transport_set_pending_fds_function (DBusTransport *transport,
+ void (* callback) (void *),
+ void *data)
+{
+ _dbus_message_loader_set_pending_fds_function (transport->loader,
+ callback, data);
+}
+
#ifdef DBUS_ENABLE_STATS
void
_dbus_transport_get_stats (DBusTransport *transport,