[PATCH] Allow eavesdropping on method calls
John (J5) Palmieri
johnp at redhat.com
Mon Jun 5 11:13:32 PDT 2006
Take 2 with a cleaner patch. I'm posting it here before I commit to get
a second pair of eyes to make sure I got the logic correct when putting
the two if statements together.
On Mon, 2006-06-05 at 12:17 -0400, Havoc Pennington wrote:
> John (J5) Palmieri wrote:
> > On Sun, 2006-06-04 at 00:46 -0400, Havoc Pennington wrote:
> >> John (J5) Palmieri wrote:
> >>> - if (type == DBUS_MESSAGE_TYPE_METHOD_CALL)
> >>> + if (type == DBUS_MESSAGE_TYPE_METHOD_CALL &&
> >>> + addressed_recipient == proposed_recipient /* not eavesdropping */)
> >>> {
> >> There's another if() right after this one with "(sender &&
> >> addressed_recipient && ...)"
> >>
> >> It would make more sense to me to put the addressed_recipient ==
> >> proposed_recipient test in that subsequent if() block, though it makes
> >> no real difference.
> >>
> >> I don't understand why this fixes eavesdropping, though it looks like a
> >> correct fix ... can you elaborate a little?
> >
> > Yes, this is because if the second "if" fails it returns FALSE, thereby
> > blocking the method from being sent. If addressed_recipient !=
> > proposed_recipient /* we are eavesdropping */ then we need to send out
> > the message. The first "if" bypasses the second "if" if we are
> > eavesdropping.
> >
>
> OK makes sense, looks good. Can you squish the two "if" together for
> clarity?
>
> Havoc
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus-allow-method-call-eavesdropping2.patch
Type: text/x-patch
Size: 1877 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060605/ee748882/dbus-allow-method-call-eavesdropping2.bin
More information about the dbus
mailing list