From 2142daadc5e39abbda2a677e4e9ef6ea5e32c608 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 28 Jul 2022 11:01:08 +1000 Subject: [PATCH] eis: capabilities can only be reduced If a REIS implementation sends multiple ConfigureCapabilities messages, the allowed capabilities would be whichever ones were sent last rather than the intersection of all capablities. Fallout from 7fc9498f1d953148db5d944105590b17b04f8c7a. --- src/libeis-client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libeis-client.c b/src/libeis-client.c index 3ee396f..21d263e 100644 --- a/src/libeis-client.c +++ b/src/libeis-client.c @@ -473,7 +473,8 @@ client_msg_configure_capabilities(struct eis_client *client, uint32_t allowed_ca if (client->state != EIS_CLIENT_STATE_NEW) return 0; - client->restrictions.cap_allow_mask = allowed_caps; + /* restrictions can only be reduced */ + client->restrictions.cap_allow_mask &= allowed_caps; return 0; }