git: 00c99e4ce4c9 - main - security/plasma6-kwallet-pam: add patches lost during transition from Plasma5

From: Max Brazhnikov <makc_at_FreeBSD.org>
Date: Mon, 05 May 2025 20:47:48 UTC
The branch main has been updated by makc:

URL: https://cgit.FreeBSD.org/ports/commit/?id=00c99e4ce4c9f1d58db6dd56a14e699346441c1d

commit 00c99e4ce4c9f1d58db6dd56a14e699346441c1d
Author:     Max Brazhnikov <makc@FreeBSD.org>
AuthorDate: 2025-05-05 20:45:30 +0000
Commit:     Max Brazhnikov <makc@FreeBSD.org>
CommitDate: 2025-05-05 20:47:42 +0000

    security/plasma6-kwallet-pam: add patches lost during transition from Plasma5
    
    while here, remove needless dependence on Qt6 libraries.
---
 security/plasma6-kwallet-pam/Makefile                       |  6 +++++-
 security/plasma6-kwallet-pam/files/patch-pam__kwallet.c     | 12 ++++++++++++
 security/plasma6-kwallet-pam/files/patch-pam__kwallet__init | 10 ++++++++++
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/security/plasma6-kwallet-pam/Makefile b/security/plasma6-kwallet-pam/Makefile
index fc57101bf941..b4aad08a3703 100644
--- a/security/plasma6-kwallet-pam/Makefile
+++ b/security/plasma6-kwallet-pam/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	kwallet-pam
 DISTVERSION=	${KDE_PLASMA_VERSION}
+PORTREVISION=	1
 CATEGORIES=	security kde kde-plasma
 
 MAINTAINER=	kde@FreeBSD.org
@@ -11,6 +12,9 @@ LIB_DEPENDS=	libgcrypt.so:security/libgcrypt \
 USES=		cmake kde:6 pkgconfig qt:6 tar:xz
 USE_KDE=	wallet \
 		ecm:build
-USE_QT=		base
+USE_QT=		# dummy
+
+post-patch:
+	@${REINPLACE_CMD} -e 's,socat,nc,' ${WRKSRC}/CMakeLists.txt
 
 .include <bsd.port.mk>
diff --git a/security/plasma6-kwallet-pam/files/patch-pam__kwallet.c b/security/plasma6-kwallet-pam/files/patch-pam__kwallet.c
new file mode 100644
index 000000000000..84d1e9568396
--- /dev/null
+++ b/security/plasma6-kwallet-pam/files/patch-pam__kwallet.c
@@ -0,0 +1,12 @@
+---pam_kwallet.c	2019-08-28 10:45:20.619019000 +0200
+--- pam_kwallet.c.orig	2021-09-16 08:40:28 UTC
++++ pam_kwallet.c
+@@ -367,7 +367,7 @@ static void execute_kwallet(pam_handle_t *pamh, struct
+     struct sockaddr_un local = {};
+     local.sun_family = AF_UNIX;
+ 
+-    if (strlen(fullSocket) > sizeof(local.sun_path)) {
++    if (strlen(fullSocket) >= sizeof(local.sun_path)) {
+         syslog(LOG_ERR, "%s: socket path %s too long to open",
+                    logPrefix, fullSocket);
+         free(fullSocket);
diff --git a/security/plasma6-kwallet-pam/files/patch-pam__kwallet__init b/security/plasma6-kwallet-pam/files/patch-pam__kwallet__init
new file mode 100644
index 000000000000..ccc444322cbb
--- /dev/null
+++ b/security/plasma6-kwallet-pam/files/patch-pam__kwallet__init
@@ -0,0 +1,10 @@
+--- pam_kwallet_init.orig	2019-08-09 12:51:25.200806000 +0200
++++ pam_kwallet_init	2019-08-09 12:51:41.765221000 +0200
+@@ -1,6 +1,6 @@
+ #!/bin/sh
+ 
+ if test -n "$PAM_KWALLET5_LOGIN" ; then
+-    env | socat STDIN UNIX-CONNECT:$PAM_KWALLET5_LOGIN
++    env | nc -U "$PAM_KWALLET5_LOGIN" | :
+ fi
+