From abaa75b10f899ada8dd05b23cc03205064394bc6 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 22 Jan 2021 20:28:19 +0000 Subject: gentoo resync : 22.01.2021 --- ...kwallet-pam-5.20.5-socket-listening-error.patch | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 kde-plasma/kwallet-pam/files/kwallet-pam-5.20.5-socket-listening-error.patch (limited to 'kde-plasma/kwallet-pam/files/kwallet-pam-5.20.5-socket-listening-error.patch') 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?= +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 + #include + #include ++#include + #include + #include + #include +@@ -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 + -- cgit v1.2.3