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 <victoria.fischer@mbition.io>
This commit is contained in:
Aleix Pol Gonzalez 2024-04-02 18:26:04 +02:00 committed by Aleix Pol Gonzalez
parent 8c6ebee318
commit 2b0b04235c

View file

@ -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);