From f266a7cfa0a488b30b0be98db2eda04b8e6c8853 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Thu, 30 Jul 2020 02:45:17 +0200 Subject: [PATCH] Only allow access to zwp_input_* to the input method It is a very privacy-concerning component, so we will treat it specifically. As it is, it will have to come from the --inputmethod argument. We can work on some UI later on to select which keyboards are available. --- wayland_server.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wayland_server.cpp b/wayland_server.cpp index 3bd53d15c3..d000d3b34a 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -270,6 +270,9 @@ public: } const QSet interfacesBlackList = {"org_kde_kwin_remote_access_manager", "org_kde_plasma_window_management", "org_kde_kwin_fake_input", "org_kde_kwin_keystate", "zkde_screencast_unstable_v1"}; + + const QSet inputmethodInterfaces = { "zwp_input_panel_v1", "zwp_input_method_v1" }; + QSet m_reported; bool allowInterface(KWaylandServer::ClientConnection *client, const QByteArray &interfaceName) override { @@ -277,6 +280,10 @@ public: return true; } + if (client != waylandServer()->inputMethodConnection() && inputmethodInterfaces.contains(interfaceName)) { + return false; + } + if (!interfacesBlackList.contains(interfaceName)) { return true; }