Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Vogtinator:lesspatch
kwin5
0001-Export-consistent-hostname-as-XAUTHLOCALHO...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Export-consistent-hostname-as-XAUTHLOCALHOSTNAME.patch of Package kwin5
From 6166db42a61d80a3d8202162c598d1476572f5a1 Mon Sep 17 00:00:00 2001 From: Fabian Vogt <fabian@ritter-vogt.de> Date: Wed, 18 Aug 2021 18:38:18 +0200 Subject: [PATCH] Export consistent hostname as XAUTHLOCALHOSTNAME To deal with hostname changes, FamilyWild is used for Xauthority, but for Xsm XAUTHLOCALHOSTNAME is also set (boo#1177835, downstream patch in xtrans). The hostname is read once on startup and then used consistently. --- src/helpers/wayland_wrapper/kwin_wrapper.cpp | 6 +++++- src/xwl/lib/xauthority.cpp | 3 +-- src/xwl/lib/xauthority.h | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/helpers/wayland_wrapper/kwin_wrapper.cpp b/src/helpers/wayland_wrapper/kwin_wrapper.cpp index 6ec91383e..722bdaed3 100644 --- a/src/helpers/wayland_wrapper/kwin_wrapper.cpp +++ b/src/helpers/wayland_wrapper/kwin_wrapper.cpp @@ -22,6 +22,7 @@ #include <QCoreApplication> #include <QDebug> +#include <QHostInfo> #include <QProcess> #include <QTemporaryFile> @@ -68,8 +69,11 @@ KWinWrapper::KWinWrapper(QObject *parent) } if (m_xwlSocket) { if (!qEnvironmentVariableIsSet("KWIN_WAYLAND_NO_XAUTHORITY")) { - if (!generateXauthorityFile(m_xwlSocket->display(), &m_xauthorityFile)) { + const QByteArray hostname = QHostInfo::localHostName().toUtf8(); + if (!generateXauthorityFile(m_xwlSocket->display(), &m_xauthorityFile, hostname)) { qCWarning(KWIN_WRAPPER) << "Failed to create an Xauthority file"; + } else { + qputenv("XAUTHLOCALHOSTNAME", hostname); } } } diff --git a/src/xwl/lib/xauthority.cpp b/src/xwl/lib/xauthority.cpp index a7b61843f..de6b87616 100644 --- a/src/xwl/lib/xauthority.cpp +++ b/src/xwl/lib/xauthority.cpp @@ -45,7 +45,7 @@ static QByteArray generateXauthorityCookie() return cookie; } -bool generateXauthorityFile(int display, QTemporaryFile *authorityFile) +bool generateXauthorityFile(int display, QTemporaryFile *authorityFile, const QByteArray &hostname) { const QString runtimeDirectory = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation); @@ -54,7 +54,6 @@ bool generateXauthorityFile(int display, QTemporaryFile *authorityFile) return false; } - const QByteArray hostname = QHostInfo::localHostName().toUtf8(); const QByteArray displayName = QByteArray::number(display); const QByteArray name = QByteArrayLiteral("MIT-MAGIC-COOKIE-1"); const QByteArray cookie = generateXauthorityCookie(); diff --git a/src/xwl/lib/xauthority.h b/src/xwl/lib/xauthority.h index 7ba232be0..ecf43e9f5 100644 --- a/src/xwl/lib/xauthority.h +++ b/src/xwl/lib/xauthority.h @@ -9,6 +9,7 @@ #pragma once +class QByteArray; class QTemporaryFile; -bool generateXauthorityFile(int display, QTemporaryFile *authorityFile); +bool generateXauthorityFile(int display, QTemporaryFile *authorityFile, const QByteArray &hostname); -- 2.32.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor