public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/pam_wrapper/files/, sys-libs/pam_wrapper/
@ 2023-02-17  7:15 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2023-02-17  7:15 UTC (permalink / raw
  To: gentoo-commits

commit:     3bae8de27d1c8f4596ea838bec571db33cec1653
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 17 07:15:00 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 17 07:15:00 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3bae8de2

sys-libs/pam_wrapper: enable py3.11

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/pam_wrapper-1.1.4-tests-import.patch     | 22 ++++++++++++++++++++
 ...1.1.4-r1.ebuild => pam_wrapper-1.1.4-r2.ebuild} | 24 +++++++++++++++++++---
 2 files changed, 43 insertions(+), 3 deletions(-)

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/pam_wrapper-1.1.4-r1.ebuild b/sys-libs/pam_wrapper/pam_wrapper-1.1.4-r2.ebuild
similarity index 77%
rename from sys-libs/pam_wrapper/pam_wrapper-1.1.4-r1.ebuild
rename to sys-libs/pam_wrapper/pam_wrapper-1.1.4-r2.ebuild
index 264a74d7a5c3..20e06b42b366 100644
--- a/sys-libs/pam_wrapper/pam_wrapper-1.1.4-r1.ebuild
+++ b/sys-libs/pam_wrapper/pam_wrapper-1.1.4-r2.ebuild
@@ -1,10 +1,9 @@
 # Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
-
-PYTHON_COMPAT=( python3_{9..10} )
+EAPI=8
 
+PYTHON_COMPAT=( python3_{9..11} )
 inherit cmake-multilib python-r1
 
 DESCRIPTION="A tool to test PAM applications and PAM modules"
@@ -31,6 +30,10 @@ DEPEND="
 	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 )
@@ -60,6 +63,21 @@ multilib_src_compile() {
 	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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/pam_wrapper/files/, sys-libs/pam_wrapper/
@ 2024-03-03  5:50 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2024-03-03  5:50 UTC (permalink / raw
  To: gentoo-commits

commit:     2649f38d3871aa2d185d7d2ec464a2c0397c9112
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Mar  3 05:36:24 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar  3 05:36:24 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2649f38d

sys-libs/pam_wrapper: add 1.1.5

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/pam_wrapper/Manifest                      |  1 +
 .../files/pam_wrapper-1.1.5-env-var-typo.patch     | 25 ++++++
 .../files/pam_wrapper-1.1.5-mkdir-race.patch       | 40 ++++++++++
 .../files/pam_wrapper-1.1.5-tests-import.patch     | 22 ++++++
 sys-libs/pam_wrapper/pam_wrapper-1.1.5.ebuild      | 90 ++++++++++++++++++++++
 5 files changed, 178 insertions(+)

diff --git a/sys-libs/pam_wrapper/Manifest b/sys-libs/pam_wrapper/Manifest
index 197fc5b91c82..8cb28f18f031 100644
--- a/sys-libs/pam_wrapper/Manifest
+++ b/sys-libs/pam_wrapper/Manifest
@@ -1 +1,2 @@
 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.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/pam_wrapper-1.1.5.ebuild b/sys-libs/pam_wrapper/pam_wrapper-1.1.5.ebuild
new file mode 100644
index 000000000000..8ce00c0e4a60
--- /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
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-03  5:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-03  5:50 [gentoo-commits] repo/gentoo:master commit in: sys-libs/pam_wrapper/files/, sys-libs/pam_wrapper/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2023-02-17  7:15 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox