diff options
author | 2021-11-15 15:13:15 +0100 | |
---|---|---|
committer | 2021-11-23 15:59:13 +0100 | |
commit | d8a6ce0f6db9297cb47efccfe21555e9706e424c (patch) | |
tree | 28b6c9eef6fecafabd09142c875900297cda23ba /kde-plasma/kwin/files | |
parent | kde-plasma/kscreen: Drop 5.23.3 (r0) (diff) | |
download | gentoo-d8a6ce0f6db9297cb47efccfe21555e9706e424c.tar.gz gentoo-d8a6ce0f6db9297cb47efccfe21555e9706e424c.tar.bz2 gentoo-d8a6ce0f6db9297cb47efccfe21555e9706e424c.zip |
kde-plasma/kwin: Fix XWayland abstract socket address
Upstream commit 5a9a3e96898bd29ccbf31d9ff92dfb80274ce265
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=442362
Reported-by: Benn Snyder <benn.snyder@gmail.com>
Bug: https://bugs.gentoo.org/813888
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-plasma/kwin/files')
-rw-r--r-- | kde-plasma/kwin/files/kwin-5.23.3-fix-xwayland-abstract-socket-addr.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/kde-plasma/kwin/files/kwin-5.23.3-fix-xwayland-abstract-socket-addr.patch b/kde-plasma/kwin/files/kwin-5.23.3-fix-xwayland-abstract-socket-addr.patch new file mode 100644 index 000000000000..7cd8d135ab28 --- /dev/null +++ b/kde-plasma/kwin/files/kwin-5.23.3-fix-xwayland-abstract-socket-addr.patch @@ -0,0 +1,49 @@ +From 5a9a3e96898bd29ccbf31d9ff92dfb80274ce265 Mon Sep 17 00:00:00 2001 +From: Weng Xuetian <wengxt@gmail.com> +Date: Thu, 11 Nov 2021 12:25:13 -0800 +Subject: [PATCH] Fix XWayland abstract socket address. + +NUL-termination byte is not needed for abstract socket. This leads to +XWayland listening to a wrong address. + +Confirmed with lsof. + +BUG: 442362 + + +(cherry picked from commit 83a036e9d40475d5c07177bf2e8bba9bc0fd4aa5) +--- + src/xwl/lib/xwaylandsocket.cpp | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/src/xwl/lib/xwaylandsocket.cpp b/src/xwl/lib/xwaylandsocket.cpp +index 786ab5cbbf..7cf9310584 100644 +--- a/src/xwl/lib/xwaylandsocket.cpp ++++ b/src/xwl/lib/xwaylandsocket.cpp +@@ -42,19 +42,18 @@ UnixSocketAddress::UnixSocketAddress(const QString &socketPath, Type type) + const QByteArray encodedSocketPath = QFile::encodeName(socketPath); + + int byteCount = offsetof(sockaddr_un, sun_path) + encodedSocketPath.size() + 1; +- if (type == Type::Abstract) { +- byteCount++; // For the first '\0'. +- } + m_buffer.resize(byteCount); + + sockaddr_un *address = reinterpret_cast<sockaddr_un *>(m_buffer.data()); + address->sun_family = AF_UNIX; + + if (type == Type::Unix) { +- qstrcpy(address->sun_path, encodedSocketPath); ++ memcpy(address->sun_path, encodedSocketPath.data(), encodedSocketPath.size()); ++ address->sun_path[encodedSocketPath.size()] = '\0'; + } else { ++ // Abstract domain socket does not need the NUL-termination byte. + *address->sun_path = '\0'; +- qstrcpy(address->sun_path + 1, encodedSocketPath); ++ memcpy(address->sun_path + 1, encodedSocketPath.data(), encodedSocketPath.size()); + } + } + +-- +GitLab + |