public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: kde-plasma/kscreenlocker/, kde-plasma/kscreenlocker/files/
@ 2016-02-09 16:25 Michael Palimaka
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Palimaka @ 2016-02-09 16:25 UTC (permalink / raw
  To: gentoo-commits

commit:     386f4b18b5bcfa51bdb9d515b79d90812f3838ad
Author:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  9 16:10:51 2016 +0000
Commit:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Tue Feb  9 16:25:13 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=386f4b18

kde-plasma/kscreenlocker: backport patch from upstream solving lock screen bypass

Gentoo-bug: 574270

Package-Manager: portage-2.2.27

 .../kscreenlocker-5.5.4-lockscreen-bypass.patch    | 39 ++++++++++++++++++++++
 ...-5.5.4.ebuild => kscreenlocker-5.5.4-r1.ebuild} |  5 ++-
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/kde-plasma/kscreenlocker/files/kscreenlocker-5.5.4-lockscreen-bypass.patch b/kde-plasma/kscreenlocker/files/kscreenlocker-5.5.4-lockscreen-bypass.patch
new file mode 100644
index 0000000..6eb6789
--- /dev/null
+++ b/kde-plasma/kscreenlocker/files/kscreenlocker-5.5.4-lockscreen-bypass.patch
@@ -0,0 +1,39 @@
+From fae65f1cdd6446042b31ccd0eafd7a4c0b6623e3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= <mgraesslin@kde.org>
+Date: Fri, 5 Feb 2016 10:30:19 +0100
+Subject: [PATCH] [greeter] Dont quit when last window closes
+
+Qt allows to have no screens. If all XRandR screens are disconnected
+there are also no QScreens. This is from an X11 perspective wrong, but
+we have to deal with it. No QScreens means that all views are destroyed
+and no new ones are created. Thus all windows close and the greeter
+exited successfully which in turn unlocked the screen.
+
+This change ensures that the greeter doesn't exit when all windows close.
+
+Funnily this was not a problem with the well known issue of Qt
+crashing when all screens are disconnected. The lock screen handles
+crashes gracefully and just restarts or more likely Qt also crashes
+the application using KSld and thus taking down the complete session.
+
+BUG: 358125
+FIXED-IN: 5.5.5
+---
+ greeter/main.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/greeter/main.cpp b/greeter/main.cpp
+index e4e679e..5625d36 100644
+--- a/greeter/main.cpp
++++ b/greeter/main.cpp
+@@ -59,6 +59,7 @@ int main(int argc, char* argv[])
+         qputenv("QT_IM_MODULE", QByteArrayLiteral("compose"));
+     }
+     ScreenLocker::UnlockApp app(argc, argv);
++    app.setQuitOnLastWindowClosed(false);
+     QCoreApplication::setApplicationName(QStringLiteral("kscreenlocker_greet"));
+     QCoreApplication::setApplicationVersion(QStringLiteral("0.1"));
+     QCoreApplication::setOrganizationDomain(QStringLiteral("kde.org"));
+-- 
+2.4.10
+

diff --git a/kde-plasma/kscreenlocker/kscreenlocker-5.5.4.ebuild b/kde-plasma/kscreenlocker/kscreenlocker-5.5.4-r1.ebuild
similarity index 94%
rename from kde-plasma/kscreenlocker/kscreenlocker-5.5.4.ebuild
rename to kde-plasma/kscreenlocker/kscreenlocker-5.5.4-r1.ebuild
index c67826d..a42158d 100644
--- a/kde-plasma/kscreenlocker/kscreenlocker-5.5.4.ebuild
+++ b/kde-plasma/kscreenlocker/kscreenlocker-5.5.4-r1.ebuild
@@ -53,7 +53,10 @@ RDEPEND="${COMMON_DEPEND}
 	!<kde-plasma/plasma-workspace-5.4.50
 "
 
-PATCHES=( "${FILESDIR}/${PN}-5.4.90-no-SUID-no-GUID.patch" )
+PATCHES=(
+	"${FILESDIR}/${PN}-5.4.90-no-SUID-no-GUID.patch"
+	"${FILESDIR}/${P}}-lockscreen-bypass.patch"
+)
 
 src_prepare() {
 	kde5_src_prepare


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: kde-plasma/kscreenlocker/, kde-plasma/kscreenlocker/files/
@ 2017-03-29 12:12 Andreas Sturmlechner
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Sturmlechner @ 2017-03-29 12:12 UTC (permalink / raw
  To: gentoo-commits

commit:     744572dc1a7741091e971105723adc4422278a54
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 29 12:10:45 2017 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Mar 29 12:11:16 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=744572dc

kde-plasma/kscreenlocker: Multiscreen: Fix manual focus on click

Reported-by: Dmitry <dmitry.ghost99 <AT> gmail.com>
Gentoo-bug: 613552

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 .../files/kscreenlocker-5.8.6-focus.patch          | 145 +++++++++++++++++++++
 .../kscreenlocker/kscreenlocker-5.8.6-r1.ebuild    |  89 +++++++++++++
 2 files changed, 234 insertions(+)

diff --git a/kde-plasma/kscreenlocker/files/kscreenlocker-5.8.6-focus.patch b/kde-plasma/kscreenlocker/files/kscreenlocker-5.8.6-focus.patch
new file mode 100644
index 00000000000..a44c36862c5
--- /dev/null
+++ b/kde-plasma/kscreenlocker/files/kscreenlocker-5.8.6-focus.patch
@@ -0,0 +1,145 @@
+From f8043de10b5dd94b9b931a92f3aa7167188786c9 Mon Sep 17 00:00:00 2001
+From: Fabian Vogt <fabian@ritter-vogt.de>
+Date: Mon, 27 Feb 2017 16:29:29 +0100
+Subject: Implement manual focus on click
+
+Summary:
+Currently only the first created screenlock window gets focus.
+On clicks, no focus events are sent, which makes it impossible to input
+passwords. This patch now makes it possible to focus to a different
+screenlock window (on a different monitor, for example) using a mouse
+button press.
+This should also fix newly created screenlock windows stealing the focus
+of already displayed ones as only the first window gains automatic focus.
+
+BUG: 348789
+BUG: 374289
+
+Test Plan:
+Locked the screen, now I can use the password input on the secondary screen
+as well.
+
+Reviewers: #plasma, graesslin, broulik
+
+Reviewed By: #plasma, graesslin
+
+Subscribers: hein, plasma-devel
+
+Tags: #plasma
+
+Differential Revision: https://phabricator.kde.org/D4821
+---
+ greeter/greeterapp.cpp |  1 -
+ x11locker.cpp          | 26 ++++++++++++++++++++++++--
+ x11locker.h            |  2 ++
+ 3 files changed, 26 insertions(+), 3 deletions(-)
+
+diff --git a/greeter/greeterapp.cpp b/greeter/greeterapp.cpp
+index 47fcb03..bcfcbdf 100644
+--- a/greeter/greeterapp.cpp
++++ b/greeter/greeterapp.cpp
+@@ -372,7 +372,6 @@ void UnlockApp::getFocus()
+     // this loop is required to make the qml/graphicsscene properly handle the shared keyboard input
+     // ie. "type something into the box of every greeter"
+     foreach (KQuickAddons::QuickViewSharedEngine *view, m_views) {
+-        view->requestActivate();
+         if (!m_testing) {
+             view->setKeyboardGrabEnabled(true); // TODO - check whether this still works in master!
+         }
+diff --git a/x11locker.cpp b/x11locker.cpp
+index b2d2ea4..6967a67 100644
+--- a/x11locker.cpp
++++ b/x11locker.cpp
+@@ -51,6 +51,7 @@ namespace ScreenLocker
+ X11Locker::X11Locker(QObject *parent)
+     : AbstractLocker(parent)
+     , QAbstractNativeEventFilter()
++    , m_focusedLockWindow(XCB_WINDOW_NONE)
+ {
+     initialize();
+ }
+@@ -229,8 +230,12 @@ void X11Locker::removeVRoot(Window win)
+     XDeleteProperty (QX11Info::display(), win, gXA_VROOT);
+ }
+ 
+-static void fakeFocusIn( WId window )
++void X11Locker::fakeFocusIn( WId window )
+ {
++    if (window == m_focusedLockWindow) {
++        return;
++    }
++
+     // We have keyboard grab, so this application will
+     // get keyboard events even without having focus.
+     // Fake FocusIn to make Qt realize it has the active
+@@ -244,6 +249,8 @@ static void fakeFocusIn( WId window )
+     ev.xfocus.detail = NotifyAncestor;
+     XSendEvent( QX11Info::display(), window, False, NoEventMask, &ev );
+     XFlush(QX11Info::display());
++
++    m_focusedLockWindow = window;
+ }
+ 
+ template< typename T>
+@@ -308,6 +315,11 @@ bool X11Locker::nativeEventFilter(const QByteArray &eventType, void *message, lo
+                         (x>=x_return && x<=x_return+(int)width_return)
+                         &&
+                         (y>=y_return && y<=y_return+(int)height_return) ) {
++                        // We need to do our own focus handling (see comment in fakeFocusIn).
++                        // For now: Focus on clicks inside the window
++                        if (responseType == XCB_BUTTON_PRESS) {
++                            fakeFocusIn(window);
++                        }
+                         const int targetX = x - x_return;
+                         const int targetY = y - y_return;
+                         if (responseType == XCB_KEY_PRESS || responseType == XCB_KEY_RELEASE) {
+@@ -386,6 +398,10 @@ bool X11Locker::nativeEventFilter(const QByteArray &eventType, void *message, lo
+                 else
+                     qDebug() << "Unknown toplevel for MapNotify";
+                 m_lockWindows.removeAll(xu->event);
++                if (m_focusedLockWindow == xu->event && !m_lockWindows.empty()) {
++                    // The currently focused window vanished, just focus the first one in the list
++                    fakeFocusIn(m_lockWindows[0]);
++                }
+                 ret = true;
+             }
+             break;
+@@ -508,8 +524,14 @@ void X11Locker::addAllowedWindow(quint32 window)
+             // not yet shown and we have a lock window, so we show our own window
+             m_background->show();
+         }
++
++        if (m_lockWindows.empty()) {
++            // Make sure to focus the first window
++            m_focusedLockWindow = XCB_WINDOW_NONE;
++            fakeFocusIn(window);
++        }
++
+         m_lockWindows.prepend(window);
+-        fakeFocusIn(window);
+         stayOnTop();
+     }
+ }
+diff --git a/x11locker.h b/x11locker.h
+index 9a14699..d8e83d6 100644
+--- a/x11locker.h
++++ b/x11locker.h
+@@ -60,6 +60,7 @@ private:
+     void setVRoot(Window win, Window vr);
+     void removeVRoot(Window win);
+     int findWindowInfo(Window w);
++    void fakeFocusIn(WId window);
+     void stayOnTop() override;
+     struct WindowInfo
+     {
+@@ -69,6 +70,7 @@ private:
+     QList<WindowInfo> m_windowInfo;
+     QList<WId> m_lockWindows;
+     QList<quint32> m_allowedWindows;
++    WId m_focusedLockWindow;
+ };
+ }
+ 
+-- 
+cgit v0.11.2
+

diff --git a/kde-plasma/kscreenlocker/kscreenlocker-5.8.6-r1.ebuild b/kde-plasma/kscreenlocker/kscreenlocker-5.8.6-r1.ebuild
new file mode 100644
index 00000000000..bc5ef666852
--- /dev/null
+++ b/kde-plasma/kscreenlocker/kscreenlocker-5.8.6-r1.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+KDE_TEST="forceoptional"
+VIRTUALX_REQUIRED="test"
+inherit kde5 pam
+
+DESCRIPTION="Library and components for secure lock screen architecture"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="pam"
+
+COMMON_DEPEND="
+	$(add_frameworks_dep kcmutils)
+	$(add_frameworks_dep kconfig)
+	$(add_frameworks_dep kconfigwidgets)
+	$(add_frameworks_dep kcoreaddons)
+	$(add_frameworks_dep kcrash)
+	$(add_frameworks_dep kdeclarative)
+	$(add_frameworks_dep kglobalaccel)
+	$(add_frameworks_dep ki18n)
+	$(add_frameworks_dep kidletime)
+	$(add_frameworks_dep knotifications)
+	$(add_frameworks_dep kpackage)
+	$(add_frameworks_dep ktextwidgets)
+	$(add_frameworks_dep kwayland)
+	$(add_frameworks_dep kwindowsystem)
+	$(add_frameworks_dep kxmlgui)
+	$(add_frameworks_dep solid)
+	$(add_qt_dep qtdbus)
+	$(add_qt_dep qtdeclarative 'widgets')
+	$(add_qt_dep qtgui)
+	$(add_qt_dep qtnetwork)
+	$(add_qt_dep qtwidgets)
+	$(add_qt_dep qtx11extras)
+	dev-libs/wayland
+	x11-libs/libX11
+	x11-libs/libXi
+	x11-libs/libxcb
+	x11-libs/xcb-util-keysyms
+	pam? ( virtual/pam )
+"
+DEPEND="${COMMON_DEPEND}
+	x11-proto/xproto
+"
+RDEPEND="${COMMON_DEPEND}
+	$(add_plasma_dep kde-cli-tools)
+	!<kde-plasma/kcheckpass-4.11.22-r1:4
+	!kde-plasma/kdebase-pam:0
+"
+
+RESTRICT+=" test"
+
+PATCHES=( "${FILESDIR}/${P}-focus.patch" )
+
+src_prepare() {
+	kde5_src_prepare
+
+	use test || sed -i \
+		-e "/add_subdirectory(autotests)/ s/^/#/" greeter/CMakeLists.txt || die
+}
+
+src_test() {
+	# requires running environment
+	local myctestargs=(
+		-E x11LockerTest
+	)
+	kde5_src_test
+}
+
+src_configure() {
+	local mycmakeargs=(
+		$(cmake-utils_use_find_package pam PAM)
+	)
+	kde5_src_configure
+}
+
+src_install() {
+	kde5_src_install
+
+	newpamd "${FILESDIR}/kde.pam" kde
+	newpamd "${FILESDIR}/kde-np.pam" kde-np
+
+	if ! use pam; then
+		chown root "${ED}"usr/$(get_libdir)/libexec/kcheckpass || die
+		chmod +s "${ED}"usr/$(get_libdir)/libexec/kcheckpass || die
+	fi
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: kde-plasma/kscreenlocker/, kde-plasma/kscreenlocker/files/
@ 2023-09-30 10:00 Andreas Sturmlechner
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Sturmlechner @ 2023-09-30 10:00 UTC (permalink / raw
  To: gentoo-commits

commit:     b19f5f8a1612cdaac637d07f6729b66d7828f835
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 28 20:05:09 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Sep 30 09:57:40 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b19f5f8a

kde-plasma/kscreenlocker: Fix kscreenlocker_greet crash w/ qmlcache

KDE-bug: https://bugs.kde.org/show_bug.cgi?id=471952

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...creenlocker-5.27.8-disable-qml-disk-cache.patch | 42 +++++++++++
 .../kscreenlocker/kscreenlocker-5.27.8-r1.ebuild   | 87 ++++++++++++++++++++++
 2 files changed, 129 insertions(+)

diff --git a/kde-plasma/kscreenlocker/files/kscreenlocker-5.27.8-disable-qml-disk-cache.patch b/kde-plasma/kscreenlocker/files/kscreenlocker-5.27.8-disable-qml-disk-cache.patch
new file mode 100644
index 000000000000..e177bb290f52
--- /dev/null
+++ b/kde-plasma/kscreenlocker/files/kscreenlocker-5.27.8-disable-qml-disk-cache.patch
@@ -0,0 +1,42 @@
+From f9b5596b2763e33319134cfd9e9fd5e6bd124a0b Mon Sep 17 00:00:00 2001
+From: Harald Sitter <sitter@kde.org>
+Date: Mon, 18 Sep 2023 10:56:47 +0200
+Subject: [PATCH] greeter: disable qml disk cache
+
+The cache currently runs risk of getting corrupted and breaking the lock
+screen until the cache hash changes or the cache file gets removed by
+the user. Since we don't necessarily need a cache here let's just
+disable it for the time being in the interest of greater fault
+tolerance.
+
+BUG: 471952
+(cherry picked from commit d1640daa360943f86196e323c4a76bde57566150)
+---
+ greeter/main.cpp | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/greeter/main.cpp b/greeter/main.cpp
+index f5c3c05c..6c2bff28 100644
+--- a/greeter/main.cpp
++++ b/greeter/main.cpp
+@@ -1,5 +1,6 @@
+ /*
+ SPDX-FileCopyrightText: 2011 Martin Gräßlin <mgraesslin@kde.org>
++SPDX-FileCopyrightText: 2023 Harald Sitter <sitter@kde.org>
+ 
+ SPDX-License-Identifier: GPL-2.0-or-later
+ */
+@@ -81,6 +82,10 @@ int main(int argc, char *argv[])
+ 
+     // Suppresses modal warnings about unwritable configuration files which may render the system inaccessible
+     qputenv("KDE_HOME_READONLY", "1");
++    // Disable QML caching to prevent cache corruption in full or near-full disk scenarios.
++    // https://bugs.kde.org/show_bug.cgi?id=471952
++    // https://bugreports.qt.io/browse/QTBUG-117130
++    qputenv("QML_DISABLE_DISK_CACHE", "1");
+ 
+     auto format = QSurfaceFormat::defaultFormat();
+     format.setOption(QSurfaceFormat::ResetNotification);
+-- 
+GitLab
+

diff --git a/kde-plasma/kscreenlocker/kscreenlocker-5.27.8-r1.ebuild b/kde-plasma/kscreenlocker/kscreenlocker-5.27.8-r1.ebuild
new file mode 100644
index 000000000000..48009bd2b6db
--- /dev/null
+++ b/kde-plasma/kscreenlocker/kscreenlocker-5.27.8-r1.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_TEST="forceoptional"
+KFMIN=5.106.0
+PVCUT=$(ver_cut 1-3)
+QTMIN=5.15.9
+inherit ecm plasma.kde.org pam
+
+DESCRIPTION="Library and components for secure lock screen architecture"
+
+LICENSE="GPL-2" # TODO: CHECK
+SLOT="5"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE=""
+
+RESTRICT="test"
+
+COMMON_DEPEND="
+	dev-libs/wayland
+	>=dev-qt/qtdbus-${QTMIN}:5
+	>=dev-qt/qtdeclarative-${QTMIN}:5
+	>=dev-qt/qtgui-${QTMIN}:5
+	>=dev-qt/qtnetwork-${QTMIN}:5
+	>=dev-qt/qtwidgets-${QTMIN}:5
+	>=dev-qt/qtx11extras-${QTMIN}:5
+	>=kde-frameworks/kcmutils-${KFMIN}:5
+	>=kde-frameworks/kconfig-${KFMIN}:5[qml]
+	>=kde-frameworks/kconfigwidgets-${KFMIN}:5
+	>=kde-frameworks/kcoreaddons-${KFMIN}:5
+	>=kde-frameworks/kcrash-${KFMIN}:5
+	>=kde-frameworks/kdeclarative-${KFMIN}:5
+	>=kde-frameworks/kglobalaccel-${KFMIN}:5
+	>=kde-frameworks/ki18n-${KFMIN}:5
+	>=kde-frameworks/kidletime-${KFMIN}:5
+	>=kde-frameworks/kio-${KFMIN}:5
+	>=kde-frameworks/knotifications-${KFMIN}:5
+	>=kde-frameworks/kpackage-${KFMIN}:5
+	>=kde-frameworks/kwayland-${KFMIN}:5
+	>=kde-frameworks/kwindowsystem-${KFMIN}:5
+	>=kde-frameworks/kxmlgui-${KFMIN}:5
+	>=kde-frameworks/solid-${KFMIN}:5
+	>=kde-plasma/layer-shell-qt-${PVCUT}:5
+	>=kde-plasma/libkscreen-${PVCUT}:5
+	sys-libs/pam
+	x11-libs/libX11
+	x11-libs/libXi
+	x11-libs/libxcb
+	x11-libs/xcb-util-keysyms
+"
+DEPEND="${COMMON_DEPEND}
+	x11-base/xorg-proto
+"
+RDEPEND="${COMMON_DEPEND}
+	>=dev-qt/qtquickcontrols2-${QTMIN}:5
+	>=kde-frameworks/kirigami-${KFMIN}:5
+	>=kde-frameworks/plasma-${KFMIN}:5
+"
+BDEPEND="
+	dev-util/wayland-scanner
+	>=kde-frameworks/kcmutils-${KFMIN}:5
+"
+PDEPEND=">=kde-plasma/kde-cli-tools-${PVCUT}:5"
+
+PATCHES=( "${FILESDIR}/${P}-disable-qml-disk-cache.patch" ) # KDE-bug 471952
+
+src_prepare() {
+	ecm_src_prepare
+	use test || cmake_run_in greeter cmake_comment_add_subdirectory autotests
+}
+
+src_test() {
+	# requires running environment
+	local myctestargs=(
+		-E x11LockerTest
+	)
+	ecm_src_test
+}
+
+src_install() {
+	ecm_src_install
+
+	newpamd "${FILESDIR}/kde.pam" kde
+	newpamd "${FILESDIR}/kde-np.pam" kde-np
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: kde-plasma/kscreenlocker/, kde-plasma/kscreenlocker/files/
@ 2024-03-30 21:03 Andreas Sturmlechner
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Sturmlechner @ 2024-03-30 21:03 UTC (permalink / raw
  To: gentoo-commits

commit:     ffcf0678eb4119b6b58aa60fcaf25a22dd8489cd
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 28 21:17:39 2024 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Mar 30 21:03:01 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ffcf0678

kde-plasma/kscreenlocker: Silence optional pam modules warnings

Also backport upstream commit 3105518ec3bc3ac88374e2c3b204f23feda91b5b
to fix a race condition.

See also:
https://invent.kde.org/plasma/kscreenlocker/-/merge_requests/150

Closes: https://bugs.gentoo.org/927032
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../{kde6-fingerprint.pam => kde-fingerprint.pam}  |  2 +-
 .../kscreenlocker/files/{kde6.pam => kde-r1.pam}   |  0
 .../{kde6-smartcard.pam => kde-smartcard.pam}      |  2 +-
 .../kscreenlocker-6.0.3-fix-lockscreen-race.patch  | 47 ++++++++++++++++++++++
 ...-6.0.3.ebuild => kscreenlocker-6.0.3-r1.ebuild} |  9 +++--
 5 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/kde-plasma/kscreenlocker/files/kde6-fingerprint.pam b/kde-plasma/kscreenlocker/files/kde-fingerprint.pam
similarity index 88%
rename from kde-plasma/kscreenlocker/files/kde6-fingerprint.pam
rename to kde-plasma/kscreenlocker/files/kde-fingerprint.pam
index 38267de65e32..6ca0ba1f09e6 100644
--- a/kde-plasma/kscreenlocker/files/kde6-fingerprint.pam
+++ b/kde-plasma/kscreenlocker/files/kde-fingerprint.pam
@@ -3,7 +3,7 @@
 auth        required    pam_shells.so
 auth        required    pam_nologin.so
 auth        required    pam_faillock.so preauth
-auth        required    pam_fprintd.so
+-auth       required    pam_fprintd.so
 auth        required    pam_env.so
 
 account     include     system-local-login

diff --git a/kde-plasma/kscreenlocker/files/kde6.pam b/kde-plasma/kscreenlocker/files/kde-r1.pam
similarity index 100%
rename from kde-plasma/kscreenlocker/files/kde6.pam
rename to kde-plasma/kscreenlocker/files/kde-r1.pam

diff --git a/kde-plasma/kscreenlocker/files/kde6-smartcard.pam b/kde-plasma/kscreenlocker/files/kde-smartcard.pam
similarity index 83%
rename from kde-plasma/kscreenlocker/files/kde6-smartcard.pam
rename to kde-plasma/kscreenlocker/files/kde-smartcard.pam
index f887c7823432..694fc1e905b0 100644
--- a/kde-plasma/kscreenlocker/files/kde6-smartcard.pam
+++ b/kde-plasma/kscreenlocker/files/kde-smartcard.pam
@@ -3,7 +3,7 @@
 auth        required    pam_shells.so
 auth        required    pam_nologin.so
 auth        required    pam_faillock.so preauth
-auth        required    pam_pkcs11.so wait_for_card card_only
+-auth       required    pam_pkcs11.so wait_for_card card_only
 auth        required    pam_env.so
 
 account     include     system-local-login

diff --git a/kde-plasma/kscreenlocker/files/kscreenlocker-6.0.3-fix-lockscreen-race.patch b/kde-plasma/kscreenlocker/files/kscreenlocker-6.0.3-fix-lockscreen-race.patch
new file mode 100644
index 000000000000..45976e0e1a14
--- /dev/null
+++ b/kde-plasma/kscreenlocker/files/kscreenlocker-6.0.3-fix-lockscreen-race.patch
@@ -0,0 +1,47 @@
+From 3105518ec3bc3ac88374e2c3b204f23feda91b5b Mon Sep 17 00:00:00 2001
+From: Dmitriy Konev <ddkonev@gmail.com>
+Date: Sun, 18 Jun 2023 16:42:56 +0300
+Subject: [PATCH] Prevent finishing greeter by unhandled signals
+
+We have time gap between main() start and KSignalHandler registration
+in which signals will close greeter
+
+First this bug tried to fix in commit c63287ca1250d60f61c4429cbeb0215f5c3bebde
+but placing KSignalHandler registration at start of main() is bad idea
+because it broke mechanism for handling signals at all
+and this behaviour was fixed in commit 448df7517021b9c2e68de161008ebc180363abed
+by moving handlers bellow
+for this reason we have this time gap
+---
+ greeter/main.cpp | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/greeter/main.cpp b/greeter/main.cpp
+index bf95cd1e..0693646e 100644
+--- a/greeter/main.cpp
++++ b/greeter/main.cpp
+@@ -57,6 +57,12 @@ static void signalHandler(int signum)
+ 
+ int main(int argc, char *argv[])
+ {
++    sigset_t blockedSignals;
++    sigemptyset(&blockedSignals);
++    sigaddset(&blockedSignals, SIGTERM);
++    sigaddset(&blockedSignals, SIGUSR1);
++    pthread_sigmask(SIG_BLOCK, &blockedSignals, NULL);
++
+     LayerShellQt::Shell::useLayerShell();
+ 
+     // disable ptrace on the greeter
+@@ -101,6 +107,8 @@ int main(int argc, char *argv[])
+     // only connect signal handler once we can actual handle the signal properly
+     QObject::connect(KSignalHandler::self(), &KSignalHandler::signalReceived, &app, &signalHandler);
+ 
++    pthread_sigmask(SIG_UNBLOCK, &blockedSignals, NULL);
++
+     app.setQuitOnLastWindowClosed(false);
+     app.setQuitLockEnabled(false);
+     QCoreApplication::setApplicationName(QStringLiteral("kscreenlocker_greet"));
+-- 
+GitLab
+

diff --git a/kde-plasma/kscreenlocker/kscreenlocker-6.0.3.ebuild b/kde-plasma/kscreenlocker/kscreenlocker-6.0.3-r1.ebuild
similarity index 89%
rename from kde-plasma/kscreenlocker/kscreenlocker-6.0.3.ebuild
rename to kde-plasma/kscreenlocker/kscreenlocker-6.0.3-r1.ebuild
index b65bf54f7c03..ba8ff49e64d2 100644
--- a/kde-plasma/kscreenlocker/kscreenlocker-6.0.3.ebuild
+++ b/kde-plasma/kscreenlocker/kscreenlocker-6.0.3-r1.ebuild
@@ -58,6 +58,8 @@ BDEPEND="
 "
 PDEPEND=">=kde-plasma/kde-cli-tools-${PVCUT}:*"
 
+PATCHES=( "${FILESDIR}/${P}-fix-lockscreen-race.patch" )
+
 src_prepare() {
 	ecm_src_prepare
 	use test || cmake_run_in greeter cmake_comment_add_subdirectory autotests
@@ -74,8 +76,7 @@ src_test() {
 src_install() {
 	ecm_src_install
 
-	local config
-	for config in kde6{,-fingerprint,-smartcard} ; do
-		newpamd "${FILESDIR}/${config}.pam" ${config/6}
-	done
+	newpamd "${FILESDIR}/kde-r1.pam" kde
+	newpamd "${FILESDIR}/kde-fingerprint.pam" kde-fingerprint
+	newpamd "${FILESDIR}/kde-smartcard.pam" kde-smartcard
 }


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: kde-plasma/kscreenlocker/, kde-plasma/kscreenlocker/files/
@ 2024-07-08 17:55 Andreas Sturmlechner
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Sturmlechner @ 2024-07-08 17:55 UTC (permalink / raw
  To: gentoo-commits

commit:     8bccc0d6db2283430ff320ad85f6d1db088c7a0e
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Mon Jul  8 17:00:21 2024 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Jul  8 17:55:02 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8bccc0d6

kde-plasma/kscreenlocker: Fix redundant unlock button

KDE-bug: https://bugs.kde.org/show_bug.cgi?id=485520

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...kscreenlocker-6.1.2-greeter-unlock-button.patch | 85 ++++++++++++++++++++++
 .../kscreenlocker/kscreenlocker-6.1.2-r1.ebuild    | 82 +++++++++++++++++++++
 2 files changed, 167 insertions(+)

diff --git a/kde-plasma/kscreenlocker/files/kscreenlocker-6.1.2-greeter-unlock-button.patch b/kde-plasma/kscreenlocker/files/kscreenlocker-6.1.2-greeter-unlock-button.patch
new file mode 100644
index 000000000000..7fc6a2e5e225
--- /dev/null
+++ b/kde-plasma/kscreenlocker/files/kscreenlocker-6.1.2-greeter-unlock-button.patch
@@ -0,0 +1,85 @@
+From 6297d4d2e37abadfab0f7389aec9aa4af7f928bc Mon Sep 17 00:00:00 2001
+From: Xaver Hugl <xaver.hugl@gmail.com>
+Date: Tue, 2 Jul 2024 20:07:06 +0000
+Subject: [PATCH] greeter/authenticators: add a property for if a prompt was
+ shown in the past
+
+This is needed to properly check for whether or not to show an unlock button
+
+CCBUG: 485520
+
+
+(cherry picked from commit bc1e4a18ce37d1f40cb6a50acf3d9c53b052bf5e)
+
+Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>
+---
+ greeter/pamauthenticators.cpp | 14 ++++++++++++++
+ greeter/pamauthenticators.h   |  5 +++++
+ 2 files changed, 19 insertions(+)
+
+diff --git a/greeter/pamauthenticators.cpp b/greeter/pamauthenticators.cpp
+index 8fcbb6d5..d564420 100644
+--- a/greeter/pamauthenticators.cpp
++++ b/greeter/pamauthenticators.cpp
+@@ -17,6 +17,7 @@ struct PamAuthenticators::Private {
+     PamAuthenticator::NoninteractiveAuthenticatorTypes computedTypes = PamAuthenticator::NoninteractiveAuthenticatorType::None;
+     AuthenticatorsState state = AuthenticatorsState::Idle;
+     bool graceLocked = false;
++    bool hadPrompt = false;
+ 
+     void recomputeNoninteractiveAuthenticationTypes()
+     {
+@@ -83,10 +84,18 @@ PamAuthenticators::PamAuthenticators(std::unique_ptr<PamAuthenticator> &&interac
+         Q_EMIT busyChanged();
+     });
+     connect(d->interactive.get(), &PamAuthenticator::prompt, this, [this] {
++        if (!d->hadPrompt) {
++            d->hadPrompt = true;
++            Q_EMIT hadPromptChanged();
++        }
+         qCDebug(KSCREENLOCKER_GREET) << "PamAuthenticators: Normal prompt from interactive authenticator" << qUtf8Printable(d->interactive->service());
+         Q_EMIT promptChanged();
+     });
+     connect(d->interactive.get(), &PamAuthenticator::promptForSecret, this, [this] {
++        if (!d->hadPrompt) {
++            d->hadPrompt = true;
++            Q_EMIT hadPromptChanged();
++        }
+         qCDebug(KSCREENLOCKER_GREET) << "PamAuthenticators: Secret prompt from interactive authenticator" << qUtf8Printable(d->interactive->service());
+         Q_EMIT promptForSecretChanged();
+     });
+@@ -198,3 +207,8 @@ void PamAuthenticators::setGraceLocked(bool b)
+ {
+     d->graceLocked = b;
+ }
++
++bool PamAuthenticators::hadPrompt() const
++{
++    return d->hadPrompt;
++}
+diff --git a/greeter/pamauthenticators.h b/greeter/pamauthenticators.h
+index e82f77b..9184e7e 100644
+--- a/greeter/pamauthenticators.h
++++ b/greeter/pamauthenticators.h
+@@ -31,6 +31,8 @@ class PamAuthenticators : public QObject
+ 
+     Q_PROPERTY(AuthenticatorsState state READ state NOTIFY stateChanged)
+ 
++    Q_PROPERTY(bool hadPrompt READ hadPrompt NOTIFY hadPromptChanged)
++
+ public:
+     PamAuthenticators(std::unique_ptr<PamAuthenticator> &&interactive,
+                       std::vector<std::unique_ptr<PamAuthenticator>> &&noninteractive,
+@@ -78,6 +80,9 @@ public:
+ 
+     void setGraceLocked(bool b);
+ 
++    bool hadPrompt() const;
++    Q_SIGNAL void hadPromptChanged();
++
+ private:
+     struct Private;
+     QScopedPointer<Private> d;
+-- 
+2.45.2
+

diff --git a/kde-plasma/kscreenlocker/kscreenlocker-6.1.2-r1.ebuild b/kde-plasma/kscreenlocker/kscreenlocker-6.1.2-r1.ebuild
new file mode 100644
index 000000000000..ab2b1699cdf0
--- /dev/null
+++ b/kde-plasma/kscreenlocker/kscreenlocker-6.1.2-r1.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_TEST="forceoptional"
+KFMIN=6.3.0
+PVCUT=$(ver_cut 1-3)
+QTMIN=6.7.1
+inherit ecm plasma.kde.org pam
+
+DESCRIPTION="Library and components for secure lock screen architecture"
+
+LICENSE="GPL-2" # TODO: CHECK
+SLOT="6"
+KEYWORDS="~amd64 ~arm64 ~riscv"
+IUSE=""
+
+RESTRICT="test"
+
+# qtbase slot op: GuiPrivate use in greeter
+COMMON_DEPEND="
+	dev-libs/wayland
+	>=dev-qt/qtbase-${QTMIN}:6=[dbus,gui,network,widgets]
+	>=dev-qt/qtdeclarative-${QTMIN}:6
+	>=kde-frameworks/kcmutils-${KFMIN}:6
+	>=kde-frameworks/kconfig-${KFMIN}:6[qml]
+	>=kde-frameworks/kconfigwidgets-${KFMIN}:6
+	>=kde-frameworks/kcoreaddons-${KFMIN}:6
+	>=kde-frameworks/kcrash-${KFMIN}:6
+	>=kde-frameworks/kglobalaccel-${KFMIN}:6
+	>=kde-frameworks/ki18n-${KFMIN}:6
+	>=kde-frameworks/kidletime-${KFMIN}:6
+	>=kde-frameworks/kio-${KFMIN}:6
+	>=kde-frameworks/knotifications-${KFMIN}:6
+	>=kde-frameworks/ksvg-${KFMIN}:6
+	>=kde-frameworks/kwindowsystem-${KFMIN}:6
+	>=kde-frameworks/solid-${KFMIN}:6
+	>=kde-plasma/layer-shell-qt-${PVCUT}:6
+	>=kde-plasma/libplasma-${PVCUT}:6
+	>=kde-plasma/libkscreen-${PVCUT}:6
+	sys-libs/pam
+	x11-libs/libX11
+	x11-libs/libXi
+	x11-libs/libxcb
+	x11-libs/xcb-util-keysyms
+"
+DEPEND="${COMMON_DEPEND}
+	x11-base/xorg-proto
+"
+RDEPEND="${COMMON_DEPEND}
+	>=kde-frameworks/kirigami-${KFMIN}:6
+	>=kde-plasma/libplasma-${PVCUT}:6
+"
+BDEPEND="
+	dev-util/wayland-scanner
+	>=kde-frameworks/kcmutils-${KFMIN}:6
+"
+PDEPEND=">=kde-plasma/kde-cli-tools-${PVCUT}:*"
+
+PATCHES=( "${FILESDIR}/${P}-greeter-unlock-button.patch" ) # KDE-bug 485520
+
+src_prepare() {
+	ecm_src_prepare
+	use test || cmake_run_in greeter cmake_comment_add_subdirectory autotests
+}
+
+src_test() {
+	# requires running environment
+	local myctestargs=(
+		-E x11LockerTest
+	)
+	ecm_src_test
+}
+
+src_install() {
+	ecm_src_install
+
+	newpamd "${FILESDIR}/kde-r1.pam" kde
+	newpamd "${FILESDIR}/kde-fingerprint.pam" kde-fingerprint
+	newpamd "${FILESDIR}/kde-smartcard.pam" kde-smartcard
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-07-08 17:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-30 21:03 [gentoo-commits] repo/gentoo:master commit in: kde-plasma/kscreenlocker/, kde-plasma/kscreenlocker/files/ Andreas Sturmlechner
  -- strict thread matches above, loose matches on Subject: below --
2024-07-08 17:55 Andreas Sturmlechner
2023-09-30 10:00 Andreas Sturmlechner
2017-03-29 12:12 Andreas Sturmlechner
2016-02-09 16:25 Michael Palimaka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox