diff options
Diffstat (limited to 'kde-misc/kdeconnect/files/kdeconnect-20.04.3-07-Limit-number-of-connected-sockets-from-unpaired-devi.patch')
-rw-r--r-- | kde-misc/kdeconnect/files/kdeconnect-20.04.3-07-Limit-number-of-connected-sockets-from-unpaired-devi.patch | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/kde-misc/kdeconnect/files/kdeconnect-20.04.3-07-Limit-number-of-connected-sockets-from-unpaired-devi.patch b/kde-misc/kdeconnect/files/kdeconnect-20.04.3-07-Limit-number-of-connected-sockets-from-unpaired-devi.patch deleted file mode 100644 index 6a6bdb01cb96..000000000000 --- a/kde-misc/kdeconnect/files/kdeconnect-20.04.3-07-Limit-number-of-connected-sockets-from-unpaired-devi.patch +++ /dev/null @@ -1,42 +0,0 @@ -From ae58b9dec49c809b85b5404cee17946116f8a706 Mon Sep 17 00:00:00 2001 -From: Albert Vaca Cintora <albertvaka@gmail.com> -Date: Thu, 24 Sep 2020 17:13:34 +0200 -Subject: [PATCH 07/10] Limit number of connected sockets from unpaired devices - -Thanks Matthias Gerstner <mgerstner@suse.de> for reporting this. ---- - core/backends/lan/lanlinkprovider.cpp | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp -index a4942c65..770e7866 100644 ---- a/core/backends/lan/lanlinkprovider.cpp -+++ b/core/backends/lan/lanlinkprovider.cpp -@@ -46,6 +46,8 @@ - - #define MIN_VERSION_WITH_SSL_SUPPORT 6 - -+static const int MAX_UNPAIRED_CONNECTIONS = 42; -+ - LanLinkProvider::LanLinkProvider( - bool testMode, - quint16 udpBroadcastPort, -@@ -555,6 +557,15 @@ void LanLinkProvider::addLink(const QString& deviceId, QSslSocket* socket, Netwo - deviceLink->reset(socket, connectionOrigin); - } else { - deviceLink = new LanDeviceLink(deviceId, this, socket, connectionOrigin); -+ // Socket disconnection will now be handled by LanDeviceLink -+ disconnect(socket, &QAbstractSocket::disconnected, socket, &QObject::deleteLater); -+ bool isDeviceTrusted = KdeConnectConfig::instance().trustedDevices().contains(deviceId); -+ if (!isDeviceTrusted && m_links.size() > MAX_UNPAIRED_CONNECTIONS) { -+ qCWarning(KDECONNECT_CORE) << "Too many unpaired devices to remember them all. Ignoring " << deviceId; -+ socket->disconnectFromHost(); -+ socket->deleteLater(); -+ return; -+ } - connect(deviceLink, &QObject::destroyed, this, &LanLinkProvider::deviceLinkDestroyed); - m_links[deviceId] = deviceLink; - if (m_pairingHandlers.contains(deviceId)) { --- -2.28.0 - |