From d57a263726eae16fd342db3a5b6601ebe83b8757 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Wed, 21 Feb 2018 14:00:44 +0100 Subject: [PATCH] bus/peer: drop sender_matches from peer_queue_call() The sender_matches were used historically to broadcast messages to eavesdropping clients at RECV-time. For many different reasons, eavesdropping is no longer supported by dbus-broker, and never will be. Hence, drop this parameter from peer_queue_call(). At the same time, drop the TODO item from activation-message transmissions. Nobody can match on unique sender names for activation messages, except when eavesdropping. Hence this cannot happen, anymore. For more details on this, also see: commit 9a581434d8ad9cf346bc7eb6c0cdbdc08c992bca Author: Tom Gundersen Date: Tue Jul 4 23:26:52 2017 +0200 driver/activation: forward activation messages using state of sender at send time Signed-off-by: David Herrmann --- src/bus/driver.c | 5 ++--- src/bus/peer.c | 2 +- src/bus/peer.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/bus/driver.c b/src/bus/driver.c index afec2d02..e8644eca 100644 --- a/src/bus/driver.c +++ b/src/bus/driver.c @@ -705,8 +705,7 @@ static int driver_name_activated(Activation *activation, Peer *receiver) { sender = peer_registry_find_peer(&receiver->bus->peers, message->message->sender_id); - /* XXX: deal with sender matches on the unique name */ - r = peer_queue_call(message->senders_policy, &sender_names, NULL, sender ? &sender->owned_replies : NULL, message->user, message->message->sender_id, receiver, message->message); + r = peer_queue_call(message->senders_policy, &sender_names, sender ? &sender->owned_replies : NULL, message->user, message->message->sender_id, receiver, message->message); if (r) { switch (r) { case PEER_E_QUOTA: @@ -1844,7 +1843,7 @@ static int driver_forward_unicast(Peer *sender, const char *destination, Message return 0; } - r = peer_queue_call(sender->policy, &sender_names, &sender->sender_matches, &sender->owned_replies, sender->user, sender->id, receiver, message); + r = peer_queue_call(sender->policy, &sender_names, &sender->owned_replies, sender->user, sender->id, receiver, message); if (r) { if (r == PEER_E_EXPECTED_REPLY_EXISTS) return DRIVER_E_EXPECTED_REPLY_EXISTS; diff --git a/src/bus/peer.c b/src/bus/peer.c index f5e56c77..2d24217d 100644 --- a/src/bus/peer.c +++ b/src/bus/peer.c @@ -595,7 +595,7 @@ void peer_flush_matches(Peer *peer) { } } -int peer_queue_call(PolicySnapshot *sender_policy, NameSet *sender_names, MatchRegistry *sender_matches, ReplyOwner *sender_replies, User *sender_user, uint64_t sender_id, Peer *receiver, Message *message) { +int peer_queue_call(PolicySnapshot *sender_policy, NameSet *sender_names, ReplyOwner *sender_replies, User *sender_user, uint64_t sender_id, Peer *receiver, Message *message) { _c_cleanup_(reply_slot_freep) ReplySlot *slot = NULL; NameSet receiver_names = NAME_SET_INIT_FROM_OWNER(&receiver->owned_names); uint32_t serial; diff --git a/src/bus/peer.h b/src/bus/peer.h index d660f95a..87d2a5b7 100644 --- a/src/bus/peer.h +++ b/src/bus/peer.h @@ -122,7 +122,7 @@ int peer_become_monitor(Peer *peer, MatchOwner *owner); void peer_stop_monitor(Peer *peer); void peer_flush_matches(Peer *peer); -int peer_queue_call(PolicySnapshot *sender_policy, NameSet *sender_names, MatchRegistry *sender_matches, ReplyOwner *sender_replies, User *sender_user, uint64_t sender_id, Peer *receiver, Message *message); +int peer_queue_call(PolicySnapshot *sender_policy, NameSet *sender_names, ReplyOwner *sender_replies, User *sender_user, uint64_t sender_id, Peer *receiver, Message *message); int peer_queue_reply(Peer *sender, const char *destination, uint32_t reply_serial, Message *message); int peer_broadcast(PolicySnapshot *sender_policy, NameSet *sender_names, MatchRegistry *matches, uint64_t sender_id, Peer *destination, Bus *bus, MatchFilter *filter, Message *message);