From 4a3ecd87295f9388b996e67ef61dc225c6232883 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 22 Sep 2006 10:53:41 +0000 Subject: Check that the caller of RFCOMM.Connect is still present before returning a successful reply --- hcid/dbus-rfcomm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hcid/dbus-rfcomm.c b/hcid/dbus-rfcomm.c index d0c28cdb..5d39c327 100644 --- a/hcid/dbus-rfcomm.c +++ b/hcid/dbus-rfcomm.c @@ -262,6 +262,12 @@ static void rfcomm_connect_cb_devnode_opened(int fd, struct pending_connect *c, goto failed; } + /* Check if the caller is still present */ + if (!dbus_bus_name_has_owner(c->conn, node->owner, NULL)) { + error("RFCOMM.Connect requestor %s exited"); + goto failed; + } + node->io = g_io_channel_unix_new(fd); g_io_channel_set_close_on_unref(node->io, TRUE); node->io_id = g_io_add_watch(node->io, G_IO_ERR | G_IO_HUP, -- cgit