summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/pam/files/fix-test-calls.patch48
-rw-r--r--sys-libs/pam/pam-1.4.0-r1.ebuild1
2 files changed, 49 insertions, 0 deletions
diff --git a/sys-libs/pam/files/fix-test-calls.patch b/sys-libs/pam/files/fix-test-calls.patch
new file mode 100644
index 000000000000..32d4c2d94997
--- /dev/null
+++ b/sys-libs/pam/files/fix-test-calls.patch
@@ -0,0 +1,48 @@
+From c5700c0a04c85ace09f6a179cc7a3692c07282b0 Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Mon, 15 Jun 2020 16:00:00 +0000
+Subject: [PATCH] configure.ac: fix non-portable use of test builtin
+
+Portable code should not assume that test builtin supports == operator.
+
+* configure.ac (opt_uidmin, opt_sysuidmin, opt_kerneloverflowuid): Fix
+initialization.
+
+Resolves: https://github.com/linux-pam/linux-pam/issues/241
+Fixes: 926d7935e ("pam_usertype: new module to tell if uid is in login.defs ranges")
+---
+ configure.ac | 15 ++++++---------
+ 1 file changed, 6 insertions(+), 9 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index c1862ea7..7737efc7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -662,21 +662,18 @@ dnl
+ dnl Get values for default uid ranges in login.defs used in pam_usertype
+ dnl
+ AC_ARG_WITH([uidmin], AS_HELP_STRING([--with-uidmin=<number>],[default value for regular user min uid (1000)]), opt_uidmin=$withval)
+-if test x"$opt_uidmin" == x; then
+- opt_uidmin=1000
+-fi
++test -n "$opt_uidmin" ||
++ opt_uidmin=1000
+ AC_DEFINE_UNQUOTED(PAM_USERTYPE_UIDMIN, $opt_uidmin, [Minimum regular user uid.])
+
+ AC_ARG_WITH([sysuidmin], AS_HELP_STRING([--with-sysuidmin=<number>],[default value for system user min uid (101)]), opt_sysuidmin=$withval)
+-if test x"$opt_sysuidmin" == x; then
+- opt_sysuidmin=101
+-fi
++test -n "$opt_sysuidmin" ||
++ opt_sysuidmin=101
+ AC_DEFINE_UNQUOTED(PAM_USERTYPE_SYSUIDMIN, $opt_sysuidmin, [Minimum system user uid.])
+
+ AC_ARG_WITH([kerneloverflowuid], AS_HELP_STRING([--with-kernel-overflow-uid=<number>],[kernel overflow uid, default (uint16_t)-2=65534]), opt_kerneloverflowuid=$withval)
+-if test x"$opt_kerneloverflowuid" == x; then
+- opt_kerneloverflowuid=65534
+-fi
++test -n "$opt_kerneloverflowuid" ||
++ opt_kerneloverflowuid=65534
+ AC_DEFINE_UNQUOTED(PAM_USERTYPE_OVERFLOW_UID, $opt_kerneloverflowuid, [Kernel overflow uid.])
+
+ AC_ARG_ENABLE([tally],
diff --git a/sys-libs/pam/pam-1.4.0-r1.ebuild b/sys-libs/pam/pam-1.4.0-r1.ebuild
index 632649733a30..65b8ffb73dc6 100644
--- a/sys-libs/pam/pam-1.4.0-r1.ebuild
+++ b/sys-libs/pam/pam-1.4.0-r1.ebuild
@@ -40,6 +40,7 @@ S="${WORKDIR}/linux-${P}"
src_prepare() {
default
touch ChangeLog || die
+ eapply "${FILESDIR}"/fix-test-calls.patch
eautoreconf
}