Closed sophie-h closed 5 months ago
What changes with this is that clients can re-use serials. I can't guarantee that this doesn't has potential security implications since I'm not familiar enough with the codebase.
Thanks for writing a patch!
LGTM but we should definitely get another review in.
Rebased due to merge conflict.
Some minor comments from me, but otherwise this looks good to me.
Well, one more comment: Maybe MAX_CLIENT_SERIAL can be made much much larger. We're only emitting "fake" requests at the beginning of the session when setting up the view of bus names, so thre is never going to be 2^31 of them.
I think MAX_CLIIENT_SERIAL should be set to something like G_MAXUINT32 - 65536
, which would allow more end-user serial numbers.
I have changed the code to
#define MAX_CLIENT_SERIAL (G_MAXUINT32 - 65536)
lgtm
Separation between messages created by client and proxy was ensured by requiring the client to use monotonically increasing serials and adding an offset to distinguish the client message from proxy messages.
The requirement to only send messages with increasing serials cannot be ensured by libraries godbus or zbus.
This commit instead reserves the lower_bit=0 space for client messages and the lower_bit=1 for messages created by the proxy. This gets rid of any serial translation mechanism and the requirement for increasing serials. However, it limits the possible values of serials available to the client to about half of the usual maximum value.
Closes #46