1 |
commit: b609cb7324518d716d722875f5f2e68619cfb98a |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jun 25 04:15:29 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 25 04:15:29 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b609cb73 |
7 |
|
8 |
sys-apps/pmount: fix implicit function declarations |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
.../pmount-0.9.99_alpha-missing-includes.patch | 82 +++++++++++++++++++ |
13 |
sys-apps/pmount/pmount-0.9.99_alpha-r7.ebuild | 92 ++++++++++++++++++++++ |
14 |
2 files changed, 174 insertions(+) |
15 |
|
16 |
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 |
17 |
new file mode 100644 |
18 |
index 000000000000..cdcb65ad822d |
19 |
--- /dev/null |
20 |
+++ b/sys-apps/pmount/files/pmount-0.9.99_alpha-missing-includes.patch |
21 |
@@ -0,0 +1,82 @@ |
22 |
+--- a/src/conffile.c |
23 |
++++ b/src/conffile.c |
24 |
+@@ -22,6 +22,7 @@ |
25 |
+ #include <sys/types.h> |
26 |
+ #include <pwd.h> |
27 |
+ #include <grp.h> |
28 |
++#include <unistd.h> |
29 |
+ |
30 |
+ #include "conffile.h" |
31 |
+ #include "config.h" |
32 |
+--- a/src/luks.c |
33 |
++++ b/src/luks.c |
34 |
+@@ -13,7 +13,9 @@ |
35 |
+ #include "utils.h" |
36 |
+ #include "policy.h" |
37 |
+ #include <stdio.h> |
38 |
++#include <fcntl.h> |
39 |
+ #include <limits.h> |
40 |
++#include <unistd.h> |
41 |
+ #include <sys/stat.h> |
42 |
+ #include <libintl.h> |
43 |
+ |
44 |
+--- a/src/policy.c |
45 |
++++ b/src/policy.c |
46 |
+@@ -13,6 +13,7 @@ |
47 |
+ #include "policy.h" |
48 |
+ #include "utils.h" |
49 |
+ |
50 |
++#include <ctype.h> |
51 |
+ #include <stdio.h> |
52 |
+ #include <string.h> |
53 |
+ #include <unistd.h> |
54 |
+--- a/src/pmount.c |
55 |
++++ b/src/pmount.c |
56 |
+@@ -29,6 +29,7 @@ |
57 |
+ #include "policy.h" |
58 |
+ #include "utils.h" |
59 |
+ #include "luks.h" |
60 |
++#include "loop.h" |
61 |
+ #include "config.h" |
62 |
+ |
63 |
+ /* Configuration file handling */ |
64 |
+--- a/src/policy.c |
65 |
++++ b/src/policy.c |
66 |
+@@ -33,6 +33,7 @@ |
67 |
+ #include <pwd.h> |
68 |
+ #include <utmpx.h> |
69 |
+ |
70 |
++#include "configuration.h" |
71 |
+ |
72 |
+ /* We use our own safe version of realpath */ |
73 |
+ #include "realpath.h" |
74 |
+--- a/src/pumount.c |
75 |
++++ b/src/pumount.c |
76 |
+@@ -24,6 +24,7 @@ |
77 |
+ #include "utils.h" |
78 |
+ #include "luks.h" |
79 |
+ #include "config.h" |
80 |
++#include "configuration.h" |
81 |
+ |
82 |
+ /* error codes */ |
83 |
+ const int E_ARGS = 1; |
84 |
+--- a/tests/test_policy.c |
85 |
++++ b/tests/test_policy.c |
86 |
+@@ -16,6 +16,7 @@ |
87 |
+ #include "policy.h" |
88 |
+ #include "utils.h" |
89 |
+ #include <stdio.h> |
90 |
++#include <string.h> |
91 |
+ |
92 |
+ int testsFailed = 0; |
93 |
+ int totalTests = 0; |
94 |
+--- a/tests/test_spawn.c |
95 |
++++ b/tests/test_spawn.c |
96 |
+@@ -12,6 +12,7 @@ |
97 |
+ |
98 |
+ |
99 |
+ #include <stdio.h> |
100 |
++#include <string.h> |
101 |
+ #include <unistd.h> |
102 |
+ #include "utils.h" |
103 |
+ |
104 |
|
105 |
diff --git a/sys-apps/pmount/pmount-0.9.99_alpha-r7.ebuild b/sys-apps/pmount/pmount-0.9.99_alpha-r7.ebuild |
106 |
new file mode 100644 |
107 |
index 000000000000..baad4714b833 |
108 |
--- /dev/null |
109 |
+++ b/sys-apps/pmount/pmount-0.9.99_alpha-r7.ebuild |
110 |
@@ -0,0 +1,92 @@ |
111 |
+# Copyright 1999-2022 Gentoo Authors |
112 |
+# Distributed under the terms of the GNU General Public License v2 |
113 |
+ |
114 |
+EAPI=8 |
115 |
+ |
116 |
+inherit bash-completion-r1 |
117 |
+ |
118 |
+DESCRIPTION="Policy based mounter that gives the ability to mount removable devices as a user" |
119 |
+HOMEPAGE="https://launchpad.net/pmount" |
120 |
+SRC_URI="mirror://debian/pool/main/p/${PN}/${PN}_${PV/_/-}.orig.tar.bz2" |
121 |
+S="${WORKDIR}"/${P/_/-} |
122 |
+ |
123 |
+LICENSE="GPL-2" |
124 |
+SLOT="0" |
125 |
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" |
126 |
+IUSE="crypt" |
127 |
+ |
128 |
+# cryptsetup is executed at runtime only, no libraries used AFAICT |
129 |
+# but in DEPEND too as it's checked during configure |
130 |
+RDEPEND=" |
131 |
+ acct-group/plugdev |
132 |
+ >=sys-apps/util-linux-2.17.2 |
133 |
+ crypt? ( >=sys-fs/cryptsetup-1.0.6-r2 )" |
134 |
+DEPEND="${RDEPEND}" |
135 |
+BDEPEND=" |
136 |
+ dev-util/intltool |
137 |
+ sys-devel/gettext" |
138 |
+ |
139 |
+PATCHES=( |
140 |
+ "${FILESDIR}"/${PN}-0.9.19-testsuite-missing-dir.patch |
141 |
+ "${FILESDIR}"/${P}-locale-regex.patch |
142 |
+ "${FILESDIR}"/${P}-exfat-support.patch |
143 |
+ "${FILESDIR}"/${P}-limits-musl.patch |
144 |
+ "${FILESDIR}"/${P}-missing-includes.patch |
145 |
+) |
146 |
+ |
147 |
+src_prepare() { |
148 |
+ # Restore default value from pmount <= 0.9.23 wrt #393633 |
149 |
+ sed -i -e '/^not_physically_logged_allow/s:=.*:= yes:' etc/pmount.conf || die |
150 |
+ |
151 |
+ cat <<-EOF > po/POTFILES.skip || die |
152 |
+ src/conffile.c |
153 |
+ src/configuration.c |
154 |
+ src/loop.c |
155 |
+ EOF |
156 |
+ |
157 |
+ default |
158 |
+} |
159 |
+ |
160 |
+src_configure() { |
161 |
+ econf --disable-hal |
162 |
+} |
163 |
+ |
164 |
+src_test() { |
165 |
+ local testdir=${S}/tests/check_fstab |
166 |
+ |
167 |
+ ln -s a "${testdir}/b" && |
168 |
+ ln -s d "${testdir}/c" && |
169 |
+ ln -s c "${testdir}/e" || |
170 |
+ die "Unable to create fake symlinks required for testsuite" |
171 |
+ |
172 |
+ emake check |
173 |
+} |
174 |
+ |
175 |
+src_install() { |
176 |
+ # Must be run SETUID+SETGID, bug #250106 |
177 |
+ exeinto /usr/bin |
178 |
+ exeopts -m 6710 -g plugdev |
179 |
+ doexe src/{p,pu}mount |
180 |
+ |
181 |
+ dodoc AUTHORS ChangeLog TODO |
182 |
+ doman man/{{p,pu}mount.1,pmount.conf.5} |
183 |
+ |
184 |
+ insinto /etc |
185 |
+ doins etc/pmount.{allow,conf} |
186 |
+ |
187 |
+ keepdir /media #501772 |
188 |
+ |
189 |
+ newbashcomp "${FILESDIR}/${PN}.bash-completion" "${PN}" |
190 |
+ bashcomp_alias pmount pumount |
191 |
+} |
192 |
+ |
193 |
+pkg_postinst() { |
194 |
+ elog |
195 |
+ elog "This package has been installed setuid and setgid." |
196 |
+ |
197 |
+ elog "The permissions are as such that only users that belong to the plugdev" |
198 |
+ elog "group are allowed to run this. But if a script run by root mounts a" |
199 |
+ elog "device, members of the plugdev group will have access to it." |
200 |
+ elog |
201 |
+ elog "Please add your user to the plugdev group to be able to mount USB drives" |
202 |
+} |