chiark / gitweb /
bus-proxyd: fix EPERM on replies
authorDavid Herrmann <dh.herrmann@gmail.com>
Thu, 8 Jan 2015 20:06:14 +0000 (21:06 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Thu, 8 Jan 2015 20:06:14 +0000 (21:06 +0100)
commitb864535791844ce4f9437cebefaf3c37b3741b4a
treee427be9f2ee61762fc7bebe9bf3f655691c1cea0
parent426bb5ddb8ff122d3e08b0480466718b68485e70
bus-proxyd: fix EPERM on replies

Imagine a kdbus peer sending a method-call without EXPECT_REPLY set
through the proxy to a dbus1 peer. The proxy turns the missing
EXPECT_REPLY flag into a dbus1 NO_REPLY_EXPECTED flag. However, if the
receipient ignores that flag (valid dbus1 behavior) and sends a reply, the
proxy will try to forward it to the original peer. This will fail with
EPERM as the kernel didn't track the reply.

We have two options now: Either we ignore EPERM for reply messages, or we
track reply-windows in the proxy so we can properly ignore replies if
EXPECT_REPLY wasn't set.

This commit chose the first option: ignore EPERM for replies. The only
down-side is that replies without matching method call will no longer be
forwarded by the proxy. This works on dbus1, though.
Nobody sane does this, so lets ignore it.
src/bus-proxyd/bus-proxyd.c