Skip to content

Commit

Permalink
bus/peer: drop sender_matches from peer_queue_call()
Browse files Browse the repository at this point in the history
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 9a58143
    Author: Tom Gundersen <[email protected]>
    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 <[email protected]>
  • Loading branch information
David Herrmann committed Feb 21, 2018
1 parent d9d9639 commit d57a263
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/bus/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/bus/peer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/bus/peer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit d57a263

Please sign in to comment.