summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2021-01-20 00:37:08 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2021-01-20 00:38:48 +0100
commit8248ba08cccbeb3d0a8632ec4b4e7871abd5e3b9 (patch)
tree6c0ccb1dc2724af97b4820c123e358919799fe97 /kde-plasma/kwallet-pam
parentapp-admin/ansible: remove unused patch(es). (diff)
downloadgentoo-8248ba08cccbeb3d0a8632ec4b4e7871abd5e3b9.tar.gz
gentoo-8248ba08cccbeb3d0a8632ec4b4e7871abd5e3b9.tar.bz2
gentoo-8248ba08cccbeb3d0a8632ec4b4e7871abd5e3b9.zip
kde-plasma/kwallet-pam: Fix automatic unlock with x11-misc/lightdm
Upstream commit 8f899902e6a3be8ad4948eb1ebdf679186aa20a7 KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=400929 Closes: https://bugs.gentoo.org/717606 Package-Manager: Portage-3.0.14, Repoman-3.0.2 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-plasma/kwallet-pam')
-rw-r--r--kde-plasma/kwallet-pam/files/kwallet-pam-5.20.5-socket-listening-error.patch44
-rw-r--r--kde-plasma/kwallet-pam/kwallet-pam-5.20.5-r1.ebuild39
2 files changed, 83 insertions, 0 deletions
diff --git a/kde-plasma/kwallet-pam/files/kwallet-pam-5.20.5-socket-listening-error.patch b/kde-plasma/kwallet-pam/files/kwallet-pam-5.20.5-socket-listening-error.patch
new file mode 100644
index 000000000000..790a644003d8
--- /dev/null
+++ b/kde-plasma/kwallet-pam/files/kwallet-pam-5.20.5-socket-listening-error.patch
@@ -0,0 +1,44 @@
+From 06cd94634feb70dfa7e2f8695b97317cb2ebe44c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Stefano=20Alo=C3=A9?= <stefano.aloe2@gmail.com>
+Date: Sun, 17 Jan 2021 23:16:57 +0100
+Subject: [PATCH] Avoid socket listening error
+
+Closing all file descriptor above 3 is causing problem to socket() and listen(). Setting FD_CLOEXEC on them solves the problem and should have exactly the same behavior.
+
+BUG: 400929
+(cherry picked from commit 8f899902e6a3be8ad4948eb1ebdf679186aa20a7)
+---
+ pam_kwallet.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/pam_kwallet.c b/pam_kwallet.c
+index 2585a68..a099872 100644
+--- a/pam_kwallet.c
++++ b/pam_kwallet.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <signal.h>
+ #include <unistd.h>
++#include <fcntl.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <errno.h>
+@@ -355,12 +356,13 @@ static int drop_privileges(struct passwd *userInfo)
+ static void execute_kwallet(pam_handle_t *pamh, struct passwd *userInfo, int toWalletPipe[2], char *fullSocket)
+ {
+ //In the child pam_syslog does not work, using syslog directly
++
+ //keep stderr open so socket doesn't returns us that fd
+ int x = 3;
+- //Close fd that are not of interest of kwallet
++ //Set FD_CLOEXEC on fd that are not of interest of kwallet
+ for (; x < 64; ++x) {
+ if (x != toWalletPipe[0]) {
+- close (x);
++ fcntl(x, F_SETFD, FD_CLOEXEC);
+ }
+ }
+
+--
+GitLab
+
diff --git a/kde-plasma/kwallet-pam/kwallet-pam-5.20.5-r1.ebuild b/kde-plasma/kwallet-pam/kwallet-pam-5.20.5-r1.ebuild
new file mode 100644
index 000000000000..2dd76daad167
--- /dev/null
+++ b/kde-plasma/kwallet-pam/kwallet-pam-5.20.5-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+KFMIN=5.74.0
+PVCUT=$(ver_cut 1-3)
+inherit ecm kde.org
+
+DESCRIPTION="PAM module to not enter KWallet password again after login"
+
+LICENSE="LGPL-2.1"
+SLOT="5"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+IUSE=""
+
+DEPEND="
+ dev-libs/libgcrypt:0=
+ >=kde-frameworks/kwallet-${KFMIN}:5
+ sys-libs/pam
+"
+RDEPEND="${DEPEND}
+ net-misc/socat
+"
+
+PATCHES=( "${FILESDIR}/${P}-socket-listening-error.patch" ) # bug 717606
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_LIBDIR="/$(get_libdir)"
+ )
+ ecm_src_configure
+}
+
+pkg_postinst() {
+ ecm_pkg_postinst
+ elog "This package enables auto-unlocking of kde-frameworks/kwallet:5."
+ elog "See also: https://wiki.gentoo.org/wiki/KDE#KWallet_auto-unlocking"
+}