summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs/pam_wrapper')
-rw-r--r--sys-libs/pam_wrapper/Manifest3
-rw-r--r--sys-libs/pam_wrapper/files/pam_wrapper-1.1.4-tests-import.patch22
-rw-r--r--sys-libs/pam_wrapper/files/pam_wrapper-1.1.5-env-var-typo.patch25
-rw-r--r--sys-libs/pam_wrapper/files/pam_wrapper-1.1.5-mkdir-race.patch40
-rw-r--r--sys-libs/pam_wrapper/files/pam_wrapper-1.1.5-tests-import.patch22
-rw-r--r--sys-libs/pam_wrapper/metadata.xml2
-rw-r--r--sys-libs/pam_wrapper/pam_wrapper-1.1.3.ebuild40
-rw-r--r--sys-libs/pam_wrapper/pam_wrapper-1.1.4-r2.ebuild88
-rw-r--r--sys-libs/pam_wrapper/pam_wrapper-1.1.4-r3.ebuild88
-rw-r--r--sys-libs/pam_wrapper/pam_wrapper-1.1.5.ebuild90
10 files changed, 378 insertions, 42 deletions
diff --git a/sys-libs/pam_wrapper/Manifest b/sys-libs/pam_wrapper/Manifest
index d4f66f3a2a4b..8cb28f18f031 100644
--- a/sys-libs/pam_wrapper/Manifest
+++ b/sys-libs/pam_wrapper/Manifest
@@ -1 +1,2 @@
-DIST pam_wrapper-1.1.3.tar.gz 118034 BLAKE2B 3c05e74959f3c6dfd35575cc5f9187f4a328bfd7ce002e327fc135c82a4ff1513add87678360992d2010c124f7fd95e4bdb3c0a4d63418d9711069cbc200e417 SHA512 3b7cbd25ae7dd73f4a0c64a7762cdeb38cc7ba6e8b4e18e79aceffea09241d520aa884de88e4105b5957b2b18ec682be6568a6bfccf82b9354a3510cd2cd98eb
+DIST pam_wrapper-1.1.4.tar.gz 170882 BLAKE2B fa0a789f6fd6f809c7ef80e354e886b5f1f0b4212060dc0e388a44701e4a1f49635b8f47344156ad65cd273660e3b0a806480c37875a830e2f5d8e56c4ec0818 SHA512 3b68dc6d7815707d74d1340facd9c2de4dff3934402ac2c2632371b39c41a75744434744ed7308e157be03a03a941405638cadb6f34995de56fb1f5f45d37de2
+DIST pam_wrapper-1.1.5.tar.gz 95037 BLAKE2B 78adeaac3994349460c2c9966e1145c3c6b78189cf1e6092cf0272bc82498c2182b114d718ce47b3403e32255d8ae5e65dee22e7bc261442323a661a4dbd1b38 SHA512 eee2c0683bd87c5416b52115105a9a2397cbec261e358ff20d9b272509f64ee5ea50a4adcb04f7791d451ca904ffd31c3bc07dc53555c3808f50f71634ab6323
diff --git a/sys-libs/pam_wrapper/files/pam_wrapper-1.1.4-tests-import.patch b/sys-libs/pam_wrapper/files/pam_wrapper-1.1.4-tests-import.patch
new file mode 100644
index 000000000000..aba9c370a22c
--- /dev/null
+++ b/sys-libs/pam_wrapper/files/pam_wrapper-1.1.4-tests-import.patch
@@ -0,0 +1,22 @@
+--- a/tests/pypamtest_test.py
++++ b/tests/pypamtest_test.py
+@@ -15,19 +15,6 @@ class PyPamTestCase(unittest.TestCase):
+ self.assertSequenceEqual(test_result.errors, info_list)
+
+ class PyPamTestImport(unittest.TestCase):
+- def setUp(self):
+- " Make sure we load the in-tree module "
+- if sys.hexversion >= 0x3000000:
+- self.modpath = os.path.join(os.getcwd(), "../src/python/python3")
+- else:
+- self.modpath = os.path.join(os.getcwd(), "../src/python/python2")
+- self.system_path = sys.path[:]
+- sys.path = [ self.modpath ]
+-
+- def tearDown(self):
+- " Restore the system path "
+- sys.path = self.system_path
+-
+ def testImport(self):
+ " Import the module "
+ try:
diff --git a/sys-libs/pam_wrapper/files/pam_wrapper-1.1.5-env-var-typo.patch b/sys-libs/pam_wrapper/files/pam_wrapper-1.1.5-env-var-typo.patch
new file mode 100644
index 000000000000..0874e5daaf24
--- /dev/null
+++ b/sys-libs/pam_wrapper/files/pam_wrapper-1.1.5-env-var-typo.patch
@@ -0,0 +1,25 @@
+https://git.samba.org/?p=pam_wrapper.git;a=commit;h=9f0cccf7432dd9be1de953f9b13a7f9b06c40442
+
+From 9f0cccf7432dd9be1de953f9b13a7f9b06c40442 Mon Sep 17 00:00:00 2001
+From: Andreas Schneider <asn@cryptomilk.org>
+Date: Fri, 10 Nov 2023 15:38:37 +0100
+Subject: [PATCH] pwrap: Fix PAM_WRAPPER_DISABLE_DEEPBIND environment variable
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+--- a/src/pam_wrapper.c
++++ b/src/pam_wrapper.c
+@@ -336,7 +336,7 @@ static void *pwrap_load_lib_handle(enum pwrap_lib lib)
+
+ #ifdef RTLD_DEEPBIND
+ const char *env_preload = getenv("LD_PRELOAD");
+- const char *env_deepbind = getenv("UID_WRAPPER_DISABLE_DEEPBIND");
++ const char *env_deepbind = getenv("PAM_WRAPPER_DISABLE_DEEPBIND");
+ bool enable_deepbind = true;
+
+ /* Don't do a deepbind if we run with libasan */
+--
+2.34.1
diff --git a/sys-libs/pam_wrapper/files/pam_wrapper-1.1.5-mkdir-race.patch b/sys-libs/pam_wrapper/files/pam_wrapper-1.1.5-mkdir-race.patch
new file mode 100644
index 000000000000..f3c1458d6dce
--- /dev/null
+++ b/sys-libs/pam_wrapper/files/pam_wrapper-1.1.5-mkdir-race.patch
@@ -0,0 +1,40 @@
+https://git.samba.org/?p=pam_wrapper.git;a=commitdiff;h=7bd24b0e54995da5f333575f97c9f1fa796fe0f1
+
+From 7bd24b0e54995da5f333575f97c9f1fa796fe0f1 Mon Sep 17 00:00:00 2001
+From: =?utf8?q?Jan=20Kundr=C3=A1t?= <jan.kundrat@cesnet.cz>
+Date: Mon, 6 Nov 2023 18:34:58 +0100
+Subject: [PATCH] die quickly upon mkdir failure
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+We just had this failure in our CI system that's currently running just
+three PAM-wrapped tests in parallel. Since this is a classic TOCTOU race
+(albeit in a test code, and therefore with little to no security
+implications), the `mkdir` can fail, and when that happens it's much
+better to just die quickly rather than continuing as if nothing
+happened.
+
+Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>
+Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
+Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
+--- a/src/pam_wrapper.c
++++ b/src/pam_wrapper.c
+@@ -893,6 +893,7 @@ static void pwrap_init(void)
+ PWRAP_LOG(PWRAP_LOG_ERROR,
+ "Failed to create pam_wrapper config dir: %s - %s",
+ tmp_config_dir, strerror(errno));
++ exit(1);
+ }
+
+ /* Create file with the PID of the the process */
+@@ -1121,6 +1122,7 @@ static void pwrap_init(void)
+ PWRAP_LOG(PWRAP_LOG_ERROR,
+ "Failed to create pam_wrapper config dir: %s - %s",
+ tmp_config_dir, strerror(errno));
++ exit(1);
+ }
+
+ /* Create file with the PID of the the process */
+--
+2.34.1
diff --git a/sys-libs/pam_wrapper/files/pam_wrapper-1.1.5-tests-import.patch b/sys-libs/pam_wrapper/files/pam_wrapper-1.1.5-tests-import.patch
new file mode 100644
index 000000000000..884583c098b4
--- /dev/null
+++ b/sys-libs/pam_wrapper/files/pam_wrapper-1.1.5-tests-import.patch
@@ -0,0 +1,22 @@
+--- a/tests/pypamtest_test.py
++++ b/tests/pypamtest_test.py
+@@ -15,19 +15,6 @@ class PyPamTestCase(unittest.TestCase):
+ self.assertSequenceEqual(test_result.errors, info_list)
+
+ class PyPamTestImport(unittest.TestCase):
+- def setUp(self):
+- " Make sure we load the in-tree module "
+- if sys.hexversion >= 0x3000000:
+- self.modpath = os.path.join(os.getcwd(), "../src/python/python3")
+- else:
+- self.assertTrue(False)
+- self.system_path = sys.path[:]
+- sys.path = [ self.modpath ]
+-
+- def tearDown(self):
+- " Restore the system path "
+- sys.path = self.system_path
+-
+ def testImport(self):
+ " Import the module "
+ try:
diff --git a/sys-libs/pam_wrapper/metadata.xml b/sys-libs/pam_wrapper/metadata.xml
index 48f6ca46f45a..74c488b2dd6e 100644
--- a/sys-libs/pam_wrapper/metadata.xml
+++ b/sys-libs/pam_wrapper/metadata.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>samba@gentoo.org</email>
diff --git a/sys-libs/pam_wrapper/pam_wrapper-1.1.3.ebuild b/sys-libs/pam_wrapper/pam_wrapper-1.1.3.ebuild
deleted file mode 100644
index 7c80c4284bc8..000000000000
--- a/sys-libs/pam_wrapper/pam_wrapper-1.1.3.ebuild
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..9} )
-CMAKE_ECLASS=cmake
-inherit cmake-multilib python-single-r1
-
-DESCRIPTION="A tool to test PAM applications and PAM modules"
-HOMEPAGE="https://cwrap.org/pam_wrapper.html"
-SRC_URI="https://www.samba.org/ftp/pub/cwrap/${P}.tar.gz
- https://ftp.samba.org/pub/cwrap/${P}.tar.gz"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc x86"
-IUSE="test"
-RESTRICT="!test? ( test )"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-RDEPEND="${PYTHON_DEPS}
- sys-libs/pam:0=[${MULTILIB_USEDEP}]"
-DEPEND="${RDEPEND}
- test? ( dev-util/cmocka[${MULTILIB_USEDEP}] )"
-
-multilib_src_configure() {
- local libpam="${EPREFIX}"
- multilib_is_native_abi || libpam+="/usr"
- libpam+="/$(get_libdir)/libpam.so.0"
-
- local mycmakeargs=(
- -DPAM_LIBRARY="${libpam}"
- -DUNIT_TESTING=$(usex test)
- -DPYTHON2_LIBRARY="/dev/null" # Disabled
- -DPYTHON3_INCLUDE_DIR="$(python_get_includedir)"
- -DPYTHON3_SITELIB="$(python_get_sitedir)"
- )
- cmake_src_configure
-}
diff --git a/sys-libs/pam_wrapper/pam_wrapper-1.1.4-r2.ebuild b/sys-libs/pam_wrapper/pam_wrapper-1.1.4-r2.ebuild
new file mode 100644
index 000000000000..5ddcce1a4b03
--- /dev/null
+++ b/sys-libs/pam_wrapper/pam_wrapper-1.1.4-r2.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..11} )
+inherit cmake-multilib python-r1
+
+DESCRIPTION="A tool to test PAM applications and PAM modules"
+HOMEPAGE="https://cwrap.org/pam_wrapper.html"
+SRC_URI="
+ https://www.samba.org/ftp/pub/cwrap/${P}.tar.gz
+ https://ftp.samba.org/pub/cwrap/${P}.tar.gz
+"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv sparc x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+# Require newer PAM so we know where it's located, bug #825078
+RDEPEND="
+ ${PYTHON_DEPS}
+ >=sys-libs/pam-1.5.2-r1:0=[${MULTILIB_USEDEP}]
+"
+DEPEND="
+ ${RDEPEND}
+ test? ( dev-util/cmocka[${MULTILIB_USEDEP}] )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.1.4-tests-import.patch
+)
+
+multilib_src_configure() {
+ configure_for_python() {
+ local mycmakeargs=( -DUNIT_TESTING=OFF )
+ cmake_src_configure
+ }
+
+ if multilib_is_native_abi ; then
+ # Build the Pythons for each version (but only for the native ABI)
+ # bug #737468
+ python_foreach_impl configure_for_python
+ fi
+
+ # Do the regular build now
+ local mycmakeargs=(
+ -DUNIT_TESTING=$(usex test)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Python{Libs,Interp,SiteLibs}=ON
+ )
+ cmake_src_configure
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi ; then
+ python_foreach_impl cmake_src_compile
+ fi
+
+ # Compile the "proper" version without Python last
+ cmake_src_compile
+}
+
+multilib_src_test() {
+ cmake_src_test
+
+ # Fails b/c of sandbox?
+ #python_test() {
+ # local -x PYTHONPATH="${BUILD_DIR}/src/python/python3:${PYTHONPATH}"
+ # elog "${PYTHONPATH}"
+ # ${EPYTHON} "${S}"/tests/pypamtest_test.py || die "Tests failed with ${EPYTHON}"
+ #}
+
+ #if multilib_is_native_abi ; then
+ # python_foreach_impl python_test
+ #fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi ; then
+ python_foreach_impl cmake_src_install
+ fi
+
+ # Install the "proper" version without Python last
+ cmake_src_install
+}
diff --git a/sys-libs/pam_wrapper/pam_wrapper-1.1.4-r3.ebuild b/sys-libs/pam_wrapper/pam_wrapper-1.1.4-r3.ebuild
new file mode 100644
index 000000000000..96d2c6f81f35
--- /dev/null
+++ b/sys-libs/pam_wrapper/pam_wrapper-1.1.4-r3.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..11} )
+inherit cmake-multilib python-r1
+
+DESCRIPTION="A tool to test PAM applications and PAM modules"
+HOMEPAGE="https://cwrap.org/pam_wrapper.html"
+SRC_URI="
+ https://www.samba.org/ftp/pub/cwrap/${P}.tar.gz
+ https://ftp.samba.org/pub/cwrap/${P}.tar.gz
+"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv sparc x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+# Require newer PAM so we know where it's located, bug #825078
+RDEPEND="
+ ${PYTHON_DEPS}
+ >=sys-libs/pam-1.5.3-r1:0=[${MULTILIB_USEDEP}]
+"
+DEPEND="
+ ${RDEPEND}
+ test? ( dev-util/cmocka[${MULTILIB_USEDEP}] )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.1.4-tests-import.patch
+)
+
+multilib_src_configure() {
+ configure_for_python() {
+ local mycmakeargs=( -DUNIT_TESTING=OFF )
+ cmake_src_configure
+ }
+
+ if multilib_is_native_abi ; then
+ # Build the Pythons for each version (but only for the native ABI)
+ # bug #737468
+ python_foreach_impl configure_for_python
+ fi
+
+ # Do the regular build now
+ local mycmakeargs=(
+ -DUNIT_TESTING=$(usex test)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Python{Libs,Interp,SiteLibs}=ON
+ )
+ cmake_src_configure
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi ; then
+ python_foreach_impl cmake_src_compile
+ fi
+
+ # Compile the "proper" version without Python last
+ cmake_src_compile
+}
+
+multilib_src_test() {
+ cmake_src_test
+
+ # Fails b/c of sandbox?
+ #python_test() {
+ # local -x PYTHONPATH="${BUILD_DIR}/src/python/python3:${PYTHONPATH}"
+ # elog "${PYTHONPATH}"
+ # ${EPYTHON} "${S}"/tests/pypamtest_test.py || die "Tests failed with ${EPYTHON}"
+ #}
+
+ #if multilib_is_native_abi ; then
+ # python_foreach_impl python_test
+ #fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi ; then
+ python_foreach_impl cmake_src_install
+ fi
+
+ # Install the "proper" version without Python last
+ cmake_src_install
+}
diff --git a/sys-libs/pam_wrapper/pam_wrapper-1.1.5.ebuild b/sys-libs/pam_wrapper/pam_wrapper-1.1.5.ebuild
new file mode 100644
index 000000000000..1c298b800f3d
--- /dev/null
+++ b/sys-libs/pam_wrapper/pam_wrapper-1.1.5.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake-multilib python-r1
+
+DESCRIPTION="A tool to test PAM applications and PAM modules"
+HOMEPAGE="https://cwrap.org/pam_wrapper.html"
+SRC_URI="
+ https://www.samba.org/ftp/pub/cwrap/${P}.tar.gz
+ https://ftp.samba.org/pub/cwrap/${P}.tar.gz
+"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv sparc x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+# Require newer PAM so we know where it's located, bug #825078
+RDEPEND="
+ ${PYTHON_DEPS}
+ >=sys-libs/pam-1.5.3-r1:0=[${MULTILIB_USEDEP}]
+"
+DEPEND="
+ ${RDEPEND}
+ test? ( dev-util/cmocka[${MULTILIB_USEDEP}] )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.1.5-tests-import.patch
+ "${FILESDIR}"/${P}-mkdir-race.patch
+ "${FILESDIR}"/${P}-env-var-typo.patch
+)
+
+multilib_src_configure() {
+ configure_for_python() {
+ local mycmakeargs=( -DUNIT_TESTING=OFF )
+ cmake_src_configure
+ }
+
+ if multilib_is_native_abi ; then
+ # Build the Pythons for each version (but only for the native ABI)
+ # bug #737468
+ python_foreach_impl configure_for_python
+ fi
+
+ # Do the regular build now
+ local mycmakeargs=(
+ -DUNIT_TESTING=$(usex test)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Python{Libs,Interp,SiteLibs}=ON
+ )
+ cmake_src_configure
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi ; then
+ python_foreach_impl cmake_src_compile
+ fi
+
+ # Compile the "proper" version without Python last
+ cmake_src_compile
+}
+
+multilib_src_test() {
+ cmake_src_test
+
+ # Fails b/c of sandbox?
+ #python_test() {
+ # local -x PYTHONPATH="${BUILD_DIR}/src/python/python3:${PYTHONPATH}"
+ # elog "${PYTHONPATH}"
+ # ${EPYTHON} "${S}"/tests/pypamtest_test.py || die "Tests failed with ${EPYTHON}"
+ #}
+
+ #if multilib_is_native_abi ; then
+ # python_foreach_impl python_test
+ #fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi ; then
+ python_foreach_impl cmake_src_install
+ fi
+
+ # Install the "proper" version without Python last
+ cmake_src_install
+}