mirror of
https://github.com/troglobit/finit.git
synced 2026-10-09 16:50:59 +07:00
libink: a broker peer is not an ordinary client
libink was written peer to peer, where one connection is one client and one principal. Attaching to a message bus breaks both halves of that, and two things followed from it. Signals never reached the system bus. Fan-out is gated on the peer having sent AddMatch, but a broker subscribes for its own clients and never sends us one, so every ServiceStateChanged was dropped on the floor. A connection attached with LINK_ATTACH_BROKER gets them all. Hello, AddMatch and RemoveMatch write per-connection state. Shared by every caller behind a broker, that lets one sender exhaust the match cap or drop another's rule, so we leave all three to the bus, whose job they are. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+2
-1
@@ -1280,7 +1280,8 @@ static int try_attach_system_bus(uev_ctx_t *ctx)
|
||||
/* link_server_attach owns the fd from this point on whether it
|
||||
* succeeds or fails, so the steal-then-attach pair has no leak
|
||||
* window. */
|
||||
conn = link_server_attach(server, link_client_steal_fd(c), (uid_t)-1);
|
||||
conn = link_server_attach(server, link_client_steal_fd(c), (uid_t)-1,
|
||||
LINK_ATTACH_BROKER);
|
||||
if (!conn)
|
||||
return -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user