public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-apps/pmount/files/, sys-apps/pmount/
@ 2020-01-05 15:18 Michał Górny
  0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2020-01-05 15:18 UTC (permalink / raw
  To: gentoo-commits

commit:     7efa28d485458743e6c25201b75526628f341af6
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  5 14:57:02 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jan  5 15:17:56 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7efa28d4

sys-apps/pmount: Bump to EAPI 7

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../pmount-0.9.19-testsuite-missing-dir.patch      |  6 ++---
 .../files/pmount-0.9.99_alpha-locale-regex.patch   |  4 ++--
 sys-apps/pmount/pmount-0.9.99_alpha-r5.ebuild      | 27 ++++++++++++----------
 3 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/sys-apps/pmount/files/pmount-0.9.19-testsuite-missing-dir.patch b/sys-apps/pmount/files/pmount-0.9.19-testsuite-missing-dir.patch
index 93d0555f0f3..319a1d6f04a 100644
--- a/sys-apps/pmount/files/pmount-0.9.19-testsuite-missing-dir.patch
+++ b/sys-apps/pmount/files/pmount-0.9.19-testsuite-missing-dir.patch
@@ -16,21 +16,21 @@ diff --git a/tests/check_fstab/a b/tests/check_fstab/a
 new file mode 100644
 index 0000000..d16d1c5
 --- /dev/null
-+++ tests/check_fstab/a
++++ b/tests/check_fstab/a
 @@ -0,0 +1 @@
 +This file is a 'dummy device file' for the fstab check
 diff --git a/tests/check_fstab/d b/tests/check_fstab/d
 new file mode 100644
 index 0000000..d16d1c5
 --- /dev/null
-+++ tests/check_fstab/d
++++ b/tests/check_fstab/d
 @@ -0,0 +1 @@
 +This file is a 'dummy device file' for the fstab check
 diff --git a/tests/check_fstab/fstab b/tests/check_fstab/fstab
 new file mode 100644
 index 0000000..8ba6f6c
 --- /dev/null
-+++ tests/check_fstab/fstab
++++ b/tests/check_fstab/fstab
 @@ -0,0 +1,6 @@
 +# A dummy fstab file for 
 +

diff --git a/sys-apps/pmount/files/pmount-0.9.99_alpha-locale-regex.patch b/sys-apps/pmount/files/pmount-0.9.99_alpha-locale-regex.patch
index c96fc055452..3dabd03c965 100644
--- a/sys-apps/pmount/files/pmount-0.9.99_alpha-locale-regex.patch
+++ b/sys-apps/pmount/files/pmount-0.9.99_alpha-locale-regex.patch
@@ -1,7 +1,7 @@
 http://bugs.gentoo.org/416985
 
---- src/conffile.c
-+++ src/conffile.c
+--- a/src/conffile.c
++++ b/src/conffile.c
 @@ -372,7 +372,7 @@ static int cf_prepare_regexps()
    /* A regexp matching a boolean value*/
  

diff --git a/sys-apps/pmount/pmount-0.9.99_alpha-r5.ebuild b/sys-apps/pmount/pmount-0.9.99_alpha-r5.ebuild
index 52df8b15b9f..7df482af2a2 100644
--- a/sys-apps/pmount/pmount-0.9.99_alpha-r5.ebuild
+++ b/sys-apps/pmount/pmount-0.9.99_alpha-r5.ebuild
@@ -1,12 +1,13 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
-inherit eutils bash-completion-r1
+EAPI=7
+inherit bash-completion-r1
 
 DESCRIPTION="Policy based mounter that gives the ability to mount removable devices as a user"
 HOMEPAGE="https://launchpad.net/pmount"
 SRC_URI="mirror://debian/pool/main/p/${PN}/${PN}_${PV/_/-}.orig.tar.bz2"
+S=${WORKDIR}/${P/_/-}
 
 LICENSE="GPL-2"
 SLOT="0"
@@ -21,21 +22,22 @@ DEPEND="${RDEPEND}
 	dev-util/intltool
 	sys-devel/gettext"
 
-S=${WORKDIR}/${P/_/-}
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.9.19-testsuite-missing-dir.patch
+	"${FILESDIR}"/${P}-locale-regex.patch
+)
 
 src_prepare() {
 	# Restore default value from pmount <= 0.9.23 wrt #393633
 	sed -i -e '/^not_physically_logged_allow/s:=.*:= yes:' etc/pmount.conf || die
 
-	cat <<-EOF > po/POTFILES.skip
+	cat <<-EOF > po/POTFILES.skip || die
 	src/conffile.c
 	src/configuration.c
 	src/loop.c
 	EOF
 
-	epatch \
-		"${FILESDIR}"/${PN}-0.9.19-testsuite-missing-dir.patch \
-		"${FILESDIR}"/${P}-locale-regex.patch
+	default
 }
 
 src_configure() {
@@ -45,14 +47,15 @@ src_configure() {
 src_test() {
 	local testdir=${S}/tests/check_fstab
 
-	ln -s $testdir/a $testdir/b && ln -s $testdir/d $testdir/c && \
-		ln -s $testdir/c $testdir/e \
-		|| die "Unable to create fake symlinks required for testsuite"
+	ln -s a "${testdir}/b" &&
+		ln -s d "${testdir}/c" &&
+		ln -s c "${testdir}/e" ||
+		die "Unable to create fake symlinks required for testsuite"
 
 	emake check
 }
 
-src_install () {
+src_install() {
 	# Must be run SETUID+SETGID, bug #250106
 	exeinto /usr/bin
 	exeopts -m 6710 -g plugdev


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

* [gentoo-commits] repo/gentoo:master commit in: sys-apps/pmount/files/, sys-apps/pmount/
@ 2022-06-25  4:15 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2022-06-25  4:15 UTC (permalink / raw
  To: gentoo-commits

commit:     b609cb7324518d716d722875f5f2e68619cfb98a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 25 04:15:29 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 25 04:15:29 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b609cb73

sys-apps/pmount: fix implicit function declarations

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

 .../pmount-0.9.99_alpha-missing-includes.patch     | 82 +++++++++++++++++++
 sys-apps/pmount/pmount-0.9.99_alpha-r7.ebuild      | 92 ++++++++++++++++++++++
 2 files changed, 174 insertions(+)

diff --git a/sys-apps/pmount/files/pmount-0.9.99_alpha-missing-includes.patch b/sys-apps/pmount/files/pmount-0.9.99_alpha-missing-includes.patch
new file mode 100644
index 000000000000..cdcb65ad822d
--- /dev/null
+++ b/sys-apps/pmount/files/pmount-0.9.99_alpha-missing-includes.patch
@@ -0,0 +1,82 @@
+--- a/src/conffile.c
++++ b/src/conffile.c
+@@ -22,6 +22,7 @@
+ #include <sys/types.h>
+ #include <pwd.h>
+ #include <grp.h>
++#include <unistd.h>
+ 
+ #include "conffile.h"
+ #include "config.h"
+--- a/src/luks.c
++++ b/src/luks.c
+@@ -13,7 +13,9 @@
+ #include "utils.h"
+ #include "policy.h"
+ #include <stdio.h>
++#include <fcntl.h>
+ #include <limits.h>
++#include <unistd.h>
+ #include <sys/stat.h>
+ #include <libintl.h>
+ 
+--- a/src/policy.c
++++ b/src/policy.c
+@@ -13,6 +13,7 @@
+ #include "policy.h"
+ #include "utils.h"
+ 
++#include <ctype.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+--- a/src/pmount.c
++++ b/src/pmount.c
+@@ -29,6 +29,7 @@
+ #include "policy.h"
+ #include "utils.h"
+ #include "luks.h"
++#include "loop.h"
+ #include "config.h"
+ 
+ /* Configuration file handling */
+--- a/src/policy.c
++++ b/src/policy.c
+@@ -33,6 +33,7 @@
+ #include <pwd.h>
+ #include <utmpx.h>
+ 
++#include "configuration.h"
+ 
+ /* We use our own safe version of realpath */
+ #include "realpath.h"
+--- a/src/pumount.c
++++ b/src/pumount.c
+@@ -24,6 +24,7 @@
+ #include "utils.h"
+ #include "luks.h"
+ #include "config.h"
++#include "configuration.h"
+ 
+ /* error codes */
+ const int E_ARGS = 1;
+--- a/tests/test_policy.c
++++ b/tests/test_policy.c
+@@ -16,6 +16,7 @@
+ #include "policy.h"
+ #include "utils.h"
+ #include <stdio.h>
++#include <string.h>
+ 
+ int testsFailed = 0;
+ int totalTests = 0;
+--- a/tests/test_spawn.c
++++ b/tests/test_spawn.c
+@@ -12,6 +12,7 @@
+ 
+ 
+ #include <stdio.h>
++#include <string.h>
+ #include <unistd.h>
+ #include "utils.h"
+ 

diff --git a/sys-apps/pmount/pmount-0.9.99_alpha-r7.ebuild b/sys-apps/pmount/pmount-0.9.99_alpha-r7.ebuild
new file mode 100644
index 000000000000..baad4714b833
--- /dev/null
+++ b/sys-apps/pmount/pmount-0.9.99_alpha-r7.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1
+
+DESCRIPTION="Policy based mounter that gives the ability to mount removable devices as a user"
+HOMEPAGE="https://launchpad.net/pmount"
+SRC_URI="mirror://debian/pool/main/p/${PN}/${PN}_${PV/_/-}.orig.tar.bz2"
+S="${WORKDIR}"/${P/_/-}
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="crypt"
+
+# cryptsetup is executed at runtime only, no libraries used AFAICT
+# but in DEPEND too as it's checked during configure
+RDEPEND="
+	acct-group/plugdev
+	>=sys-apps/util-linux-2.17.2
+	crypt? ( >=sys-fs/cryptsetup-1.0.6-r2 )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	dev-util/intltool
+	sys-devel/gettext"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.9.19-testsuite-missing-dir.patch
+	"${FILESDIR}"/${P}-locale-regex.patch
+	"${FILESDIR}"/${P}-exfat-support.patch
+	"${FILESDIR}"/${P}-limits-musl.patch
+	"${FILESDIR}"/${P}-missing-includes.patch
+)
+
+src_prepare() {
+	# Restore default value from pmount <= 0.9.23 wrt #393633
+	sed -i -e '/^not_physically_logged_allow/s:=.*:= yes:' etc/pmount.conf || die
+
+	cat <<-EOF > po/POTFILES.skip || die
+	src/conffile.c
+	src/configuration.c
+	src/loop.c
+	EOF
+
+	default
+}
+
+src_configure() {
+	econf --disable-hal
+}
+
+src_test() {
+	local testdir=${S}/tests/check_fstab
+
+	ln -s a "${testdir}/b" &&
+		ln -s d "${testdir}/c" &&
+		ln -s c "${testdir}/e" ||
+		die "Unable to create fake symlinks required for testsuite"
+
+	emake check
+}
+
+src_install() {
+	# Must be run SETUID+SETGID, bug #250106
+	exeinto /usr/bin
+	exeopts -m 6710 -g plugdev
+	doexe src/{p,pu}mount
+
+	dodoc AUTHORS ChangeLog TODO
+	doman man/{{p,pu}mount.1,pmount.conf.5}
+
+	insinto /etc
+	doins etc/pmount.{allow,conf}
+
+	keepdir /media #501772
+
+	newbashcomp "${FILESDIR}/${PN}.bash-completion" "${PN}"
+	bashcomp_alias pmount pumount
+}
+
+pkg_postinst() {
+	elog
+	elog "This package has been installed setuid and setgid."
+
+	elog "The permissions are as such that only users that belong to the plugdev"
+	elog "group are allowed to run this. But if a script run by root mounts a"
+	elog "device, members of the plugdev group will have access to it."
+	elog
+	elog "Please add your user to the plugdev group to be able to mount USB drives"
+}


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

* [gentoo-commits] repo/gentoo:master commit in: sys-apps/pmount/files/, sys-apps/pmount/
@ 2024-02-10 10:02 Joonas Niilola
  0 siblings, 0 replies; 3+ messages in thread
From: Joonas Niilola @ 2024-02-10 10:02 UTC (permalink / raw
  To: gentoo-commits

commit:     c2295920c514d39794c18f1cabbce5b15a1c0fcc
Author:     Alexander Golubev <fatzer2 <AT> gmail <DOT> com>
AuthorDate: Sun Jan 21 07:12:04 2024 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sat Feb 10 10:01:57 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2295920

sys-apps/pmount: fix a bug in bundled realpath

Closes: https://bugs.gentoo.org/741810
Signed-off-by: Alexander Golubev <fatzer2 <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/34934
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 ...9_alpha-fix-buggy-realpath-implementation.patch | 31 ++++++++
 sys-apps/pmount/pmount-0.9.99_alpha-r8.ebuild      | 93 ++++++++++++++++++++++
 2 files changed, 124 insertions(+)

diff --git a/sys-apps/pmount/files/pmount-0.9.99_alpha-fix-buggy-realpath-implementation.patch b/sys-apps/pmount/files/pmount-0.9.99_alpha-fix-buggy-realpath-implementation.patch
new file mode 100644
index 000000000000..f1d7f7d4c0fc
--- /dev/null
+++ b/sys-apps/pmount/files/pmount-0.9.99_alpha-fix-buggy-realpath-implementation.patch
@@ -0,0 +1,31 @@
+Fix bug in realpath implementation bundled with pmount which caused it to
+likely fail on paths with several symlinks.
+
+The issue was first noticed by failure in tests:
+Gentoo-Bug: https://bugs.gentoo.org/741810
+--- pmount-0.9.99-alpha/src/realpath.c.orig	2024-01-21 09:19:55.776224329 +0300
++++ pmount-0.9.99-alpha/src/realpath.c	2024-01-21 09:30:46.751233027 +0300
+@@ -128,6 +128,7 @@
+ 		} else {
+ #ifdef resolve_symlinks		/* Richard Gooch dislikes sl resolution */
+ 			int m;
++			char *old_buf;
+ 
+ 			/* Note: readlink doesn't add the null byte. */
+ 			link_path[n] = '\0';
+@@ -141,12 +142,13 @@
+ 
+ 			/* Insert symlink contents into path. */
+ 			m = strlen(path);
+-			if (buf)
+-				free(buf);
++			old_buf = buf; /* path might point to buf at this point */
+ 			buf = xmalloc(m + n + 1);
+ 			memcpy(buf, link_path, n);
+ 			memcpy(buf + n, path, m + 1);
+ 			path = buf;
++			if (old_buf)
++				free(old_buf);
+ #endif
+ 		}
+ 		*npath++ = '/';

diff --git a/sys-apps/pmount/pmount-0.9.99_alpha-r8.ebuild b/sys-apps/pmount/pmount-0.9.99_alpha-r8.ebuild
new file mode 100644
index 000000000000..4b0c16d89431
--- /dev/null
+++ b/sys-apps/pmount/pmount-0.9.99_alpha-r8.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1
+
+DESCRIPTION="Policy based mounter that gives the ability to mount removable devices as a user"
+HOMEPAGE="https://launchpad.net/pmount"
+SRC_URI="mirror://debian/pool/main/p/${PN}/${PN}_${PV/_/-}.orig.tar.bz2"
+S="${WORKDIR}"/${P/_/-}
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="crypt"
+
+# cryptsetup is executed at runtime only, no libraries used AFAICT
+# but in DEPEND too as it's checked during configure
+RDEPEND="
+	acct-group/plugdev
+	>=sys-apps/util-linux-2.17.2
+	crypt? ( >=sys-fs/cryptsetup-1.0.6-r2 )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	dev-util/intltool
+	sys-devel/gettext"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.9.19-testsuite-missing-dir.patch
+	"${FILESDIR}"/${P}-locale-regex.patch
+	"${FILESDIR}"/${P}-exfat-support.patch
+	"${FILESDIR}"/${P}-limits-musl.patch
+	"${FILESDIR}"/${P}-missing-includes.patch
+	"${FILESDIR}"/${P}-fix-buggy-realpath-implementation.patch
+)
+
+src_prepare() {
+	# Restore default value from pmount <= 0.9.23 wrt #393633
+	sed -i -e '/^not_physically_logged_allow/s:=.*:= yes:' etc/pmount.conf || die
+
+	cat <<-EOF > po/POTFILES.skip || die
+	src/conffile.c
+	src/configuration.c
+	src/loop.c
+	EOF
+
+	default
+}
+
+src_configure() {
+	econf --disable-hal
+}
+
+src_test() {
+	local testdir=${S}/tests/check_fstab
+
+	ln -s a "${testdir}/b" &&
+		ln -s d "${testdir}/c" &&
+		ln -s c "${testdir}/e" ||
+		die "Unable to create fake symlinks required for testsuite"
+
+	emake check
+}
+
+src_install() {
+	# Must be run SETUID+SETGID, bug #250106
+	exeinto /usr/bin
+	exeopts -m 6710 -g plugdev
+	doexe src/{p,pu}mount
+
+	dodoc AUTHORS ChangeLog TODO
+	doman man/{{p,pu}mount.1,pmount.conf.5}
+
+	insinto /etc
+	doins etc/pmount.{allow,conf}
+
+	keepdir /media #501772
+
+	newbashcomp "${FILESDIR}/${PN}.bash-completion" "${PN}"
+	bashcomp_alias pmount pumount
+}
+
+pkg_postinst() {
+	elog
+	elog "This package has been installed setuid and setgid."
+
+	elog "The permissions are as such that only users that belong to the plugdev"
+	elog "group are allowed to run this. But if a script run by root mounts a"
+	elog "device, members of the plugdev group will have access to it."
+	elog
+	elog "Please add your user to the plugdev group to be able to mount USB drives"
+}


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

end of thread, other threads:[~2024-02-10 10:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-10 10:02 [gentoo-commits] repo/gentoo:master commit in: sys-apps/pmount/files/, sys-apps/pmount/ Joonas Niilola
  -- strict thread matches above, loose matches on Subject: below --
2022-06-25  4:15 Sam James
2020-01-05 15:18 Michał Górny

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