From 69180ed6bcc990de4f14da37feccc513b98a4934 Mon Sep 17 00:00:00 2001 From: Luca Matei Pintilie Date: Wed, 24 Apr 2024 18:46:16 +0200 Subject: [PATCH] ngircd: update to 27~rc1. --- srcpkgs/ngircd/patches/0001-getpid-fix.patch | 30 +++++++++++++ .../ngircd/patches/0002-getpid-fix-2.patch | 22 ++++++++++ ...when-setgid-setuid-fails-with-EINVAL.patch | 43 +++++++++++++++++++ srcpkgs/ngircd/template | 12 +++--- 4 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 srcpkgs/ngircd/patches/0001-getpid-fix.patch create mode 100644 srcpkgs/ngircd/patches/0002-getpid-fix-2.patch create mode 100644 srcpkgs/ngircd/patches/don-t-abort-startup-when-setgid-setuid-fails-with-EINVAL.patch diff --git a/srcpkgs/ngircd/patches/0001-getpid-fix.patch b/srcpkgs/ngircd/patches/0001-getpid-fix.patch new file mode 100644 index 00000000000000..4765604bea554f --- /dev/null +++ b/srcpkgs/ngircd/patches/0001-getpid-fix.patch @@ -0,0 +1,30 @@ +From a33d15751b3e3910bd06125efbeae6569844f313 Mon Sep 17 00:00:00 2001 +From: Alexander Barton +Date: Sat, 13 Apr 2024 15:52:33 +0200 +Subject: [PATCH] Test suite: Don't use "pgrep -u" when LOGNAME and USER are + not set + +Thanks for reporting this on IRC, luca! +--- + src/testsuite/getpid.sh | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/testsuite/getpid.sh b/src/testsuite/getpid.sh +index 85059142..3cc186e1 100755 +--- a/src/testsuite/getpid.sh ++++ b/src/testsuite/getpid.sh +@@ -23,7 +23,13 @@ if [ -x /usr/bin/pgrep ]; then + *) + PGREP_FLAGS="" + esac +- exec /usr/bin/pgrep $PGREP_FLAGS -n -u "${LOGNAME:-$USER}" "$1" ++ if [ -n "$LOGNAME" ] || [ -n "$USER" ]; then ++ # Try to narrow the search down to the current user ... ++ exec /usr/bin/pgrep $PGREP_FLAGS -n -u "${LOGNAME:-$USER}" "$1" ++ else ++ # ... but neither LOGNAME nor USER were set! ++ exec /usr/bin/pgrep $PGREP_FLAGS -n "$1" ++ fi + fi + + # pidof(1) could be a good alternative on elder Linux systems diff --git a/srcpkgs/ngircd/patches/0002-getpid-fix-2.patch b/srcpkgs/ngircd/patches/0002-getpid-fix-2.patch new file mode 100644 index 00000000000000..8bbd59a37e354b --- /dev/null +++ b/srcpkgs/ngircd/patches/0002-getpid-fix-2.patch @@ -0,0 +1,22 @@ +From b77b9432c45d6f38c0ad6d9021afb4dd91f163e4 Mon Sep 17 00:00:00 2001 +From: Alexander Barton +Date: Sat, 13 Apr 2024 16:04:29 +0200 +Subject: [PATCH] Test suite: Correctly test for LOGNAME and USER + +--- + src/testsuite/getpid.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/testsuite/getpid.sh b/src/testsuite/getpid.sh +index 3cc186e1..7a3dbe37 100755 +--- a/src/testsuite/getpid.sh ++++ b/src/testsuite/getpid.sh +@@ -23,7 +23,7 @@ if [ -x /usr/bin/pgrep ]; then + *) + PGREP_FLAGS="" + esac +- if [ -n "$LOGNAME" ] || [ -n "$USER" ]; then ++ if [ -n "${LOGNAME:-}" ] || [ -n "${USER:-}" ]; then + # Try to narrow the search down to the current user ... + exec /usr/bin/pgrep $PGREP_FLAGS -n -u "${LOGNAME:-$USER}" "$1" + else diff --git a/srcpkgs/ngircd/patches/don-t-abort-startup-when-setgid-setuid-fails-with-EINVAL.patch b/srcpkgs/ngircd/patches/don-t-abort-startup-when-setgid-setuid-fails-with-EINVAL.patch new file mode 100644 index 00000000000000..21100f74bc789c --- /dev/null +++ b/srcpkgs/ngircd/patches/don-t-abort-startup-when-setgid-setuid-fails-with-EINVAL.patch @@ -0,0 +1,43 @@ +From 6ec213cd8cf1e65d3c912f8f8eba663a2bf93fb5 Mon Sep 17 00:00:00 2001 +From: Alexander Barton +Date: Sat, 13 Apr 2024 19:43:54 +0200 +Subject: [PATCH] Don't abort startup when setgid/setuid() fails with EINVAL + +Both setgid(2) as well as setuid(2) can fail with EINVAL in addition to +EPERM, their manual pages state "EINVAL: The user/group ID specified in +uid/gid is not valid in this user namespace ". + +So not only treat EPERM as an "acceptable error" and continue with +logging the error, but do the same for EINVAL. + +This was triggered by the Void Linux xbps-uunshare(1) tool used for +building "XBPS source packages" and reported by luca in #ngircd. Thanks! +--- + src/ngircd/ngircd.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c +index b0610392..c2169c43 100644 +--- a/src/ngircd/ngircd.c ++++ b/src/ngircd/ngircd.c +@@ -722,7 +722,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon) + Log(LOG_ERR, "Can't change group ID to %s(%u): %s!", + grp ? grp->gr_name : "?", Conf_GID, + strerror(real_errno)); +- if (real_errno != EPERM) ++ if (real_errno != EPERM && real_errno != EINVAL) + goto out; + } + #ifdef HAVE_SETGROUPS +@@ -748,7 +748,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon) + Log(LOG_ERR, "Can't change user ID to %s(%u): %s!", + pwd ? pwd->pw_name : "?", Conf_UID, + strerror(real_errno)); +- if (real_errno != EPERM) ++ if (real_errno != EPERM && real_errno != EINVAL) + goto out; + } + } +-- +2.39.2 + diff --git a/srcpkgs/ngircd/template b/srcpkgs/ngircd/template index 66c09814f049ef..4a32f9d807d360 100644 --- a/srcpkgs/ngircd/template +++ b/srcpkgs/ngircd/template @@ -1,18 +1,20 @@ # Template file for 'ngircd' pkgname=ngircd -version=26 -revision=4 +version=27~rc1 +revision=1 build_style=gnu-configure -configure_args="--enable-ipv6 --with-openssl --without-ident ac_cv_func_getaddrinfo=yes" +configure_args="--enable-ipv6 --with-openssl --without-ident ac_cv_func_getaddrinfo=yes --with-pam --with-iconv" hostmakedepends="pkg-config" -makedepends="zlib-devel openssl-devel" +makedepends="zlib-devel openssl-devel pam-devel libticonv-devel" +checkdepends="procps-ng expect inetutils-telnet" conf_files="/etc/ngircd.conf" short_desc="Free, portable and lightweight Internet Relay Chat server" maintainer="Orphaned " license="GPL-2.0-or-later" homepage="http://ngircd.barton.de/" distfiles="https://ngircd.barton.de/pub/ngircd/ngircd-${version}.tar.xz" -checksum=56dcc6483058699fcdd8e54f5010eecee09824b93bad7ed5f18818e550d855c6 +checksum=ef04b85e99ffda2bdf73a823848f04a1d5aa4f288beb631dae2dcc0d34e5c665 +make_check="ci-skip" # Stopping the integration test servers fails in CI post_configure() { echo "#define HAVE_WORKING_GETADDRINFO 1" >>src/config.h