From 2b0b04235c6eea3fc45287ae52bf28c189846876 Mon Sep 17 00:00:00 2001 From: Aleix Pol Gonzalez Date: Tue, 2 Apr 2024 18:26:04 +0200 Subject: [PATCH] wayland_server: Only check if there's an executable when we check permissions There's not much point checking that we can convert an executable into a file if we are not going to use that file. Signed-off-by: Victoria Fischer --- src/wayland_server.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/wayland_server.cpp b/src/wayland_server.cpp index 2605e1d71e..db6097ae4f 100644 --- a/src/wayland_server.cpp +++ b/src/wayland_server.cpp @@ -158,13 +158,12 @@ public: return true; } - if (client->executablePath().isEmpty()) { - qCDebug(KWIN_CORE) << "Could not identify process with pid" << client->processId(); - return false; - } - static bool permissionCheckDisabled = qEnvironmentVariableIntValue("KWIN_WAYLAND_NO_PERMISSION_CHECKS") == 1; if (!permissionCheckDisabled) { + if (client->executablePath().isEmpty()) { + qCDebug(KWIN_CORE) << "Could not identify process with pid" << client->processId(); + return false; + } auto requestedInterfaces = client->property("requestedInterfaces"); if (requestedInterfaces.isNull()) { requestedInterfaces = fetchRequestedInterfaces(client);