Changeset View
Changeset View
Standalone View
Standalone View
wayland_server.cpp
Show First 20 Lines • Show All 228 Lines • ▼ Show 20 Line(s) | 227 | if (servicesFound.isEmpty()) { | |||
---|---|---|---|---|---|
229 | return {}; | 229 | return {}; | ||
230 | } | 230 | } | ||
231 | 231 | | |||
232 | const auto interfaces = servicesFound.first()->property("X-KDE-Wayland-Interfaces").toStringList(); | 232 | const auto interfaces = servicesFound.first()->property("X-KDE-Wayland-Interfaces").toStringList(); | ||
233 | qCDebug(KWIN_CORE) << "Interfaces for" << client->executablePath() << interfaces; | 233 | qCDebug(KWIN_CORE) << "Interfaces for" << client->executablePath() << interfaces; | ||
234 | return interfaces; | 234 | return interfaces; | ||
235 | } | 235 | } | ||
236 | 236 | | |||
237 | QSet<QByteArray> interfacesBlackList = {"org_kde_kwin_remote_access_manager", "org_kde_plasma_window_management", "org_kde_kwin_fake_input", "org_kde_kwin_keystate"}; | 237 | const QSet<QByteArray> interfacesBlackList = {"org_kde_kwin_remote_access_manager", "org_kde_plasma_window_management", "org_kde_kwin_fake_input", "org_kde_kwin_keystate"}; | ||
238 | QSet<QString> m_reported; | ||||
238 | 239 | | |||
239 | bool allowInterface(KWaylandServer::ClientConnection *client, const QByteArray &interfaceName) override { | 240 | bool allowInterface(KWaylandServer::ClientConnection *client, const QByteArray &interfaceName) override { | ||
240 | if (client->processId() == getpid()) { | 241 | if (client->processId() == getpid()) { | ||
241 | return true; | 242 | return true; | ||
242 | } | 243 | } | ||
243 | 244 | | |||
244 | if (!interfacesBlackList.contains(interfaceName)) { | 245 | if (!interfacesBlackList.contains(interfaceName)) { | ||
245 | return true; | 246 | return true; | ||
246 | } | 247 | } | ||
247 | 248 | | |||
248 | if (client->executablePath().isEmpty()) { | 249 | if (client->executablePath().isEmpty()) { | ||
249 | qCWarning(KWIN_CORE) << "Could not identify process with pid" << client->processId(); | 250 | qCWarning(KWIN_CORE) << "Could not identify process with pid" << client->processId(); | ||
250 | return false; | 251 | return false; | ||
251 | } | 252 | } | ||
252 | 253 | | |||
253 | { | 254 | { | ||
254 | auto requestedInterfaces = client->property("requestedInterfaces"); | 255 | auto requestedInterfaces = client->property("requestedInterfaces"); | ||
255 | if (requestedInterfaces.isNull()) { | 256 | if (requestedInterfaces.isNull()) { | ||
256 | requestedInterfaces = fetchRequestedInterfaces(client); | 257 | requestedInterfaces = fetchRequestedInterfaces(client); | ||
257 | client->setProperty("requestedInterfaces", requestedInterfaces); | 258 | client->setProperty("requestedInterfaces", requestedInterfaces); | ||
258 | } | 259 | } | ||
259 | if (!requestedInterfaces.toStringList().contains(QString::fromUtf8(interfaceName))) { | 260 | if (!requestedInterfaces.toStringList().contains(QString::fromUtf8(interfaceName))) { | ||
260 | qCWarning(KWIN_CORE) << "Did not grant the interface" << interfaceName << "to" << client->executablePath() << ". Please request it under X-KDE-Wayland-Interfaces"; | 261 | if (KWIN_CORE().isDebugEnabled()) { | ||
262 | const QString id = client->executablePath() + QLatin1Char('|') + QString::fromUtf8(interfaceName); | ||||
263 | if (!m_reported.contains({id})) { | ||||
264 | m_reported.insert(id); | ||||
265 | qCDebug(KWIN_CORE) << "Interface" << interfaceName << "not in X-KDE-Wayland-Interfaces of" << client->executablePath(); | ||||
266 | } | ||||
267 | } | ||||
261 | return false; | 268 | return false; | ||
262 | } | 269 | } | ||
263 | } | 270 | } | ||
264 | 271 | | |||
265 | { | 272 | { | ||
266 | auto trustedOrigin = client->property("isPrivileged"); | 273 | auto trustedOrigin = client->property("isPrivileged"); | ||
267 | if (trustedOrigin.isNull()) { | 274 | if (trustedOrigin.isNull()) { | ||
268 | trustedOrigin = isTrustedOrigin(client); | 275 | trustedOrigin = isTrustedOrigin(client); | ||
▲ Show 20 Lines • Show All 567 Lines • Show Last 20 Lines |