ocaml-wayland icon indicating copy to clipboard operation
ocaml-wayland copied to clipboard

Support disconnecting a client with a protocol error

Open DemiMarie opened this issue 1 year ago • 3 comments

I’m planning on using wayland-proxy-virtwl in Qubes OS. To protect the host compositor, Qubes OS requires that the proxy validate incoming requests and reject ones that violate the protocol or appear to be malicious. However, I can’t see any way to disconnect the client with a protocol error.

DemiMarie avatar Jul 20 '24 18:07 DemiMarie

You should be able to do it in two steps: send the error (Wl_display.error) and then disconnect (Server.stop).

talex5 avatar Jul 29 '24 19:07 talex5

Though it might be that stop shuts the connection down before the queued error is sent. Possibly calling stop should add a stop message to outbox and have it shut down the connection when it gets to that?

talex5 avatar Jul 29 '24 19:07 talex5

Though it might be that stop shuts the connection down before the queued error is sent. Possibly calling stop should add a stop message to outbox and have it shut down the connection when it gets to that?

Maybe? There is also a use-case for shutting things down immediately.

Can you look at #46? That implements enough features so that errors posted by the host compositor are received by the guest client. Most of the work is on protocol error handling.

DemiMarie avatar Jul 29 '24 23:07 DemiMarie