Skip to content

gdbus: Never buffer reads during server authentication

Otherwise, the content of the buffer is thrown away when switching from reading via a GDataInputStream to unbuffered reads when waiting for the "BEGIN" line.

(The code already tried to protect against over-reading like this by using unbuffered reads for the last few lines of the auth protocol, but it might already be too late at that point. The buffer of the GDataInputStream might already contain the "BEGIN" line for example.)

This matters when connecting a sd-bus client directly to a GDBus client. A sd-bus client optimistically sends the whole auth conversation in one go without waiting for intermediate replies. This is done to improve performance for the many short-lived connections that are typically made.


I am sending this for my colleague @mvollmer. He originally sent this to https://github.com/GNOME/glib/pull/38 , but apparently has some troubles with his GNOME gitlab account.

Fixes #2916 (closed)

Merge request reports