Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/mc/, app-misc/mc/files/
Date: Fri, 01 Oct 2021 09:43:18
Message-Id: 1633081375.7bf490bf9bec287e3927af2df506fa63a9e245f1.polynomial-c@gentoo
1 commit: 7bf490bf9bec287e3927af2df506fa63a9e245f1
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 1 09:42:55 2021 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 1 09:42:55 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7bf490bf
7
8 app-misc/mc: Security cleanup
9
10 Bug: https://bugs.gentoo.org/811159
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 app-misc/mc/Manifest | 1 -
14 app-misc/mc/files/mc-4.8.26-file-seccomp.patch | 142 -------------------------
15 app-misc/mc/files/mc-4.8.26-shadow-crash.patch | 39 -------
16 app-misc/mc/mc-4.8.26-r4.ebuild | 125 ----------------------
17 app-misc/mc/mc-4.8.26-r5.ebuild | 131 -----------------------
18 5 files changed, 438 deletions(-)
19
20 diff --git a/app-misc/mc/Manifest b/app-misc/mc/Manifest
21 index 771926154e4..24aa9112735 100644
22 --- a/app-misc/mc/Manifest
23 +++ b/app-misc/mc/Manifest
24 @@ -1,2 +1 @@
25 -DIST mc-4.8.26.tar.xz 2492612 BLAKE2B e13ab99fb7d5a9e2cf1149ad96d763681b0186fbf5c03fc9e349a57a4a6f48b598c9eeed85e4cb94a18c5c5b89d4ee0e21f6d34c8cfd5e21da53551085aa3469 SHA512 f2f06915b775ecc94016fe5d5db9301e953cc89ee0708e79ee96e14a9f53142a467b27061ca57f65b40310fa86d4d13e2f2a29a601f8fefa6216fb10f73007be
26 DIST mc-4.8.27.tar.xz 2510296 BLAKE2B efb0f3a8beb7285a793085a8e3b3a49619d0f8a4babff7de90f7a462cf6c013bbc08b92bc48e2c2e2204799332cd0160a86e201d9368cabde78e653b4306763f SHA512 c955d66cee06e3a0e0c795f2f6b98b184762363390a903cf8ef83dc5e98e6e94d5a9c06c4788d9ff4b3ae111541df8c7dc0b864a5c21c40421a81cd8690e9a69
27
28 diff --git a/app-misc/mc/files/mc-4.8.26-file-seccomp.patch b/app-misc/mc/files/mc-4.8.26-file-seccomp.patch
29 deleted file mode 100644
30 index 0a36f47f3a4..00000000000
31 --- a/app-misc/mc/files/mc-4.8.26-file-seccomp.patch
32 +++ /dev/null
33 @@ -1,142 +0,0 @@
34 -https://bugs.gentoo.org/776988
35 -https://github.com/MidnightCommander/mc/commit/1ed638d66cf803f69ac12ee80a72d217f2146e43
36 -
37 -From 1ed638d66cf803f69ac12ee80a72d217f2146e43 Mon Sep 17 00:00:00 2001
38 -From: Andrew Borodin <aborodin@×××××.ru>
39 -Date: Tue, 16 Feb 2021 16:29:51 +0300
40 -Subject: [PATCH] Ticket #4180: fix zip handling.
41 -
42 -After 8857423e4ebb770b6f0ea3103abf5d35c85fcbe8 zip archives opened with
43 -an error:
44 -
45 - file -L -z archive.zip: Bad system call
46 -
47 -This caused by using /usr/bin/file with -z option, because seccomp (a
48 -security sandbox) doesn't allow it..
49 -
50 -Solution: use -S option together with -z one.
51 -
52 -The file command accepts the -S option since 5.33.
53 -
54 -Signed-off-by: Andrew Borodin <aborodin@×××××.ru>
55 ----
56 - configure.ac | 66 +++++++++++++++++++++++++++++++++++--------
57 - src/filemanager/ext.c | 7 +++--
58 - src/setup.c | 2 ++
59 - 3 files changed, 60 insertions(+), 15 deletions(-)
60 -
61 -diff --git a/configure.ac b/configure.ac
62 -index 5f372dc3f5..f2351c99ad 100644
63 ---- a/configure.ac
64 -+++ b/configure.ac
65 -@@ -115,23 +115,65 @@ fi
66 - AC_SUBST(MANDOC)
67 - AC_SUBST(MAN_FLAGS)
68 -
69 --dnl Check for -L option to file
70 -+dnl Check for -z, -L, and -S options to file
71 - AC_CHECK_PROG(HAVE_FILECMD, file, true, false)
72 - if $HAVE_FILECMD; then
73 -- AC_MSG_CHECKING([for -L option to file command])
74 -- AC_CACHE_VAL(mc_cv_filel, [
75 -- file -L . > /dev/null 2>&1
76 -- if test $? = 0; then
77 -- mc_cv_filel=yes
78 -+ dnl Don't use the file command if it doesn't accept the -z option
79 -+ AC_MSG_CHECKING([for -z option to file command])
80 -+ AC_CACHE_VAL(mc_cv_file_z, [
81 -+ file -z . > /dev/null 2>&1
82 -+ if test $? = 0; then
83 -+ mc_cv_file_z=yes
84 -+ else
85 -+ mc_cv_file_z=no
86 -+ fi
87 -+ ])
88 -+ AC_MSG_RESULT([$mc_cv_file_z])
89 -+
90 -+ if test x$mc_cv_file_z = xyes; then
91 -+ AC_DEFINE(USE_FILE_CMD, 1, [Define if the file command accepts the -z option])
92 - else
93 -- mc_cv_filel=no
94 -+ AC_MSG_WARN([The file command doesn't accept the -z option and will not be used])
95 - fi
96 -- ])
97 -- if test x$mc_cv_filel = xyes; then
98 -- AC_DEFINE(FILE_L, 1, [Define if the file command accepts the -L option])
99 -+
100 -+ if test x$mc_cv_file_z = xyes; then
101 -+ dnl file is used; check -L and -S options
102 -+
103 -+ AC_MSG_CHECKING([for -L option to file command])
104 -+ AC_CACHE_VAL(mc_cv_file_L, [
105 -+ file -L . > /dev/null 2>&1
106 -+ if test $? = 0; then
107 -+ mc_cv_file_L=yes
108 -+ else
109 -+ mc_cv_file_L=no
110 -+ fi
111 -+ ])
112 -+ AC_MSG_RESULT([$mc_cv_file_L])
113 -+
114 -+ if test x$mc_cv_file_L = xyes; then
115 -+ AC_DEFINE(FILE_L, "-L ", [Define if the file command accepts the -L option])
116 -+ else
117 -+ AC_DEFINE(FILE_L, "", [Define if the file command accepts the -L option])
118 -+ fi
119 -+
120 -+ dnl The file command accepts the -S option since 5.33
121 -+ AC_MSG_CHECKING([for -S option to file command])
122 -+ AC_CACHE_VAL(mc_cv_file_S, [
123 -+ file -S . > /dev/null 2>&1
124 -+ if test $? = 0; then
125 -+ mc_cv_file_S=yes
126 -+ else
127 -+ mc_cv_file_S=no
128 -+ fi
129 -+ ])
130 -+ AC_MSG_RESULT([$mc_cv_file_S])
131 -+
132 -+ if test x$mc_cv_file_S = xyes; then
133 -+ AC_DEFINE(FILE_S, "-S ", [Define if file command accepts the -S option])
134 -+ else
135 -+ AC_DEFINE(FILE_S, "", [Define if file command accepts the -S option])
136 -+ fi
137 - fi
138 -- filel=$mc_cv_filel
139 -- AC_MSG_RESULT([$filel])
140 - fi
141 -
142 - dnl Only list browsers here that can be run in background (i.e. with `&')
143 -diff --git a/src/filemanager/ext.c b/src/filemanager/ext.c
144 -index 4e6f10c6c5..d6a09df7bb 100644
145 ---- a/src/filemanager/ext.c
146 -+++ b/src/filemanager/ext.c
147 -@@ -71,10 +71,11 @@
148 -
149 - /*** file scope macro definitions ****************************************************************/
150 -
151 --#ifdef FILE_L
152 --#define FILE_CMD "file -L -z "
153 -+#ifdef USE_FILE_CMD
154 -+#define FILE_CMD "file -z " FILE_S FILE_L
155 - #else
156 --#define FILE_CMD "file -z "
157 -+/* actually file is unused, but define some reasonable command */
158 -+#define FILE_CMD "file "
159 - #endif
160 -
161 - /*** file scope type declarations ****************************************************************/
162 -diff --git a/src/setup.c b/src/setup.c
163 -index 77c07649d5..2ef07f2569 100644
164 ---- a/src/setup.c
165 -+++ b/src/setup.c
166 -@@ -317,7 +317,9 @@ static const struct
167 - { "old_esc_mode", &old_esc_mode },
168 - { "cd_symlinks", &mc_global.vfs.cd_symlinks },
169 - { "show_all_if_ambiguous", &mc_global.widget.show_all_if_ambiguous },
170 -+#ifdef USE_FILE_CMD
171 - { "use_file_to_guess_type", &use_file_to_check_type },
172 -+#endif
173 - { "alternate_plus_minus", &mc_global.tty.alternate_plus_minus },
174 - { "only_leading_plus_minus", &only_leading_plus_minus },
175 - { "show_output_starts_shell", &output_starts_shell },
176
177 diff --git a/app-misc/mc/files/mc-4.8.26-shadow-crash.patch b/app-misc/mc/files/mc-4.8.26-shadow-crash.patch
178 deleted file mode 100644
179 index 4eeee45bc8e..00000000000
180 --- a/app-misc/mc/files/mc-4.8.26-shadow-crash.patch
181 +++ /dev/null
182 @@ -1,39 +0,0 @@
183 -https://bugs.gentoo.org/768285
184 -https://midnight-commander.org/ticket/4192
185 -
186 -From 6394547dbffbad44ea50c64c282de4b610ca07bf Mon Sep 17 00:00:00 2001
187 -From: Sergei Trofimovich <slyfox@g.o>
188 -Date: Wed, 3 Feb 2021 09:47:13 +0300
189 -Subject: [PATCH] Ticket #4192: fix crash if shadow is out of screen.
190 -
191 -(tty_clip): add extra tests for area boundaries.
192 -
193 -Signed-off-by: Andrew Borodin <aborodin@×××××.ru>
194 ----
195 - lib/tty/tty-ncurses.c | 7 +++++++
196 - 1 file changed, 7 insertions(+)
197 -
198 -diff --git a/lib/tty/tty-ncurses.c b/lib/tty/tty-ncurses.c
199 -index 03235cd5b..5cddf5059 100644
200 ---- a/lib/tty/tty-ncurses.c
201 -+++ b/lib/tty/tty-ncurses.c
202 -@@ -152,9 +152,16 @@ tty_clip (int *y, int *x, int *rows, int *cols)
203 -
204 - if (*y + *rows > LINES)
205 - *rows = LINES - *y;
206 -+
207 -+ if (*rows <= 0)
208 -+ return FALSE;
209 -+
210 - if (*x + *cols > COLS)
211 - *cols = COLS - *x;
212 -
213 -+ if (*cols <= 0)
214 -+ return FALSE;
215 -+
216 - return TRUE;
217 - }
218 -
219 ---
220 -2.30.0
221 -
222
223 diff --git a/app-misc/mc/mc-4.8.26-r4.ebuild b/app-misc/mc/mc-4.8.26-r4.ebuild
224 deleted file mode 100644
225 index 26d020ad5a2..00000000000
226 --- a/app-misc/mc/mc-4.8.26-r4.ebuild
227 +++ /dev/null
228 @@ -1,125 +0,0 @@
229 -# Copyright 1999-2021 Gentoo Authors
230 -# Distributed under the terms of the GNU General Public License v2
231 -
232 -EAPI=7
233 -
234 -inherit autotools flag-o-matic
235 -
236 -MY_P=${P/_/-}
237 -
238 -DESCRIPTION="GNU Midnight Commander is a text based file manager"
239 -HOMEPAGE="https://midnight-commander.org"
240 -SRC_URI="http://ftp.midnight-commander.org/${MY_P}.tar.xz"
241 -
242 -LICENSE="GPL-3"
243 -SLOT="0"
244 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x86-solaris"
245 -IUSE="+edit gpm nls samba sftp +slang spell test unicode X +xdg"
246 -
247 -REQUIRED_USE="spell? ( edit )"
248 -
249 -RDEPEND=">=dev-libs/glib-2.26.0:2
250 - gpm? ( sys-libs/gpm )
251 - kernel_linux? ( sys-fs/e2fsprogs )
252 - samba? ( net-fs/samba )
253 - sftp? ( net-libs/libssh2 )
254 - slang? ( >=sys-libs/slang-2 )
255 - !slang? ( sys-libs/ncurses:=[unicode(+)?] )
256 - spell? ( app-text/aspell )
257 - X? ( x11-libs/libX11
258 - x11-libs/libICE
259 - x11-libs/libXau
260 - x11-libs/libXdmcp
261 - x11-libs/libSM )"
262 -DEPEND="${RDEPEND}
263 - app-arch/xz-utils
264 - virtual/pkgconfig
265 - nls? ( sys-devel/gettext )
266 - test? ( dev-libs/check )
267 - "
268 -
269 -PATCHES=(
270 - "${FILESDIR}"/${P}-shadow-crash.patch
271 - "${FILESDIR}"/${P}-file-seccomp.patch
272 -)
273 -
274 -RESTRICT="!test? ( test )"
275 -
276 -S="${WORKDIR}/${MY_P}"
277 -
278 -pkg_pretend() {
279 - if use slang && use unicode ; then
280 - ewarn "\"unicode\" USE flag only takes effect when the \"slang\" USE flag is disabled."
281 - fi
282 -}
283 -
284 -src_prepare() {
285 - default
286 -
287 - # patch touches configure.ac
288 - eautoreconf
289 -}
290 -
291 -src_configure() {
292 - [[ ${CHOST} == *-solaris* ]] && append-ldflags "-lnsl -lsocket"
293 -
294 - local myeconfargs=(
295 - --enable-charset
296 - --enable-vfs
297 - --with-homedir=$(usex xdg 'XDG' '.mc')
298 - --with-screen=$(usex slang 'slang' "ncurses$(usex unicode 'w' '')")
299 - $(use_enable kernel_linux vfs-undelfs)
300 - # Today mclib does not expose any headers and is linked to
301 - # single 'mc' binary. Thus there is no advantage of having
302 - # a library. Let's avoid shared library altogether
303 - # as it also conflicts with sci-libs/mc: bug #685938
304 - --disable-mclib
305 - $(use_enable nls)
306 - $(use_enable samba vfs-smb)
307 - $(use_enable sftp vfs-sftp)
308 - $(use_enable spell aspell)
309 - $(use_enable test tests)
310 - $(use_with gpm gpm-mouse)
311 - $(use_with X x)
312 - $(use_with edit internal-edit)
313 - )
314 - econf "${myeconfargs[@]}"
315 -}
316 -
317 -src_test() {
318 - # CK_FORK=no to avoid using fork() in check library
319 - # as mc mocks fork() itself: bug #644462.
320 - #
321 - # VERBOSE=1 to make test failures contain detailed
322 - # information.
323 - CK_FORK=no emake check VERBOSE=1
324 -}
325 -
326 -src_install() {
327 - emake DESTDIR="${D}" install
328 - dodoc AUTHORS README NEWS
329 -
330 - # fix bug #334383
331 - if use kernel_linux && [[ ${EUID} == 0 ]] ; then
332 - fowners root:tty /usr/libexec/mc/cons.saver
333 - fperms g+s /usr/libexec/mc/cons.saver
334 - fi
335 -
336 - if ! use xdg ; then
337 - sed 's@MC_XDG_OPEN="xdg-open"@MC_XDG_OPEN="/bin/false"@' \
338 - -i "${ED}"/usr/libexec/mc/ext.d/*.sh || die
339 - fi
340 -}
341 -
342 -pkg_postinst() {
343 - if use spell && ! has_version app-dicts/aspell-en ; then
344 - elog "'spell' USE flag is enabled however app-dicts/aspell-en is not installed."
345 - elog "You should manually set 'spell_language' in the Misc section of ~/.config/mc/ini"
346 - elog "It has to be set to one of your installed aspell dictionaries or 'NONE'"
347 - elog
348 - fi
349 -
350 - elog "To enable exiting to latest working directory,"
351 - elog "put this into your ~/.bashrc:"
352 - elog ". ${EPREFIX}/usr/libexec/mc/mc.sh"
353 -}
354
355 diff --git a/app-misc/mc/mc-4.8.26-r5.ebuild b/app-misc/mc/mc-4.8.26-r5.ebuild
356 deleted file mode 100644
357 index 7bd110cd799..00000000000
358 --- a/app-misc/mc/mc-4.8.26-r5.ebuild
359 +++ /dev/null
360 @@ -1,131 +0,0 @@
361 -# Copyright 1999-2021 Gentoo Authors
362 -# Distributed under the terms of the GNU General Public License v2
363 -
364 -EAPI=8
365 -
366 -inherit autotools flag-o-matic
367 -
368 -MY_P=${P/_/-}
369 -
370 -DESCRIPTION="GNU Midnight Commander is a text based file manager"
371 -HOMEPAGE="https://midnight-commander.org"
372 -SRC_URI="http://ftp.midnight-commander.org/${MY_P}.tar.xz"
373 -
374 -LICENSE="GPL-3"
375 -SLOT="0"
376 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x86-solaris"
377 -IUSE="+edit gpm nls samba sftp +slang spell test unicode X +xdg"
378 -
379 -REQUIRED_USE="spell? ( edit )"
380 -
381 -RDEPEND=">=dev-libs/glib-2.26.0:2
382 - gpm? ( sys-libs/gpm )
383 - kernel_linux? ( sys-fs/e2fsprogs )
384 - samba? ( net-fs/samba )
385 - sftp? ( net-libs/libssh2 )
386 - slang? ( >=sys-libs/slang-2 )
387 - !slang? ( sys-libs/ncurses:=[unicode(+)?] )
388 - spell? ( app-text/aspell )
389 - X? ( x11-libs/libX11
390 - x11-libs/libICE
391 - x11-libs/libXau
392 - x11-libs/libXdmcp
393 - x11-libs/libSM )"
394 -DEPEND="${RDEPEND}"
395 -BDEPEND="app-arch/xz-utils
396 - virtual/pkgconfig
397 - nls? ( sys-devel/gettext )
398 - test? ( dev-libs/check )"
399 -
400 -PATCHES=(
401 - "${FILESDIR}"/${PN}-4.8.26-file-seccomp.patch
402 - "${FILESDIR}"/${PN}-4.8.26-ncurses-mouse.patch
403 - "${FILESDIR}"/${PN}-4.8.26-shadow-crash.patch
404 -)
405 -
406 -RESTRICT="!test? ( test )"
407 -
408 -S="${WORKDIR}/${MY_P}"
409 -
410 -pkg_pretend() {
411 - if use slang && use unicode ; then
412 - ewarn "\"unicode\" USE flag only takes effect when the \"slang\" USE flag is disabled."
413 - fi
414 -}
415 -
416 -src_prepare() {
417 - default
418 -
419 - # patch touches configure.ac
420 - eautoreconf
421 -}
422 -
423 -src_configure() {
424 - [[ ${CHOST} == *-solaris* ]] && append-ldflags "-lnsl -lsocket"
425 -
426 - local myeconfargs=(
427 - --enable-charset
428 - --enable-vfs
429 - --with-homedir=$(usex xdg 'XDG' '.mc')
430 - --with-screen=$(usex slang 'slang' "ncurses$(usex unicode 'w' '')")
431 - $(use_enable kernel_linux vfs-undelfs)
432 - # Today mclib does not expose any headers and is linked to
433 - # single 'mc' binary. Thus there is no advantage of having
434 - # a library. Let's avoid shared library altogether
435 - # as it also conflicts with sci-libs/mc: bug #685938
436 - --disable-mclib
437 - $(use_enable nls)
438 - $(use_enable samba vfs-smb)
439 - $(use_enable sftp vfs-sftp)
440 - $(use_enable spell aspell)
441 - $(use_enable test tests)
442 - $(use_with gpm gpm-mouse)
443 - $(use_with X x)
444 - $(use_with edit internal-edit)
445 - )
446 - econf "${myeconfargs[@]}"
447 -}
448 -
449 -src_test() {
450 - # Bug #759466
451 - if [[ ${EUID} == 0 ]]; then
452 - ewarn "You are emerging ${PN} as root with 'userpriv' disabled." \
453 - "Expect some test failures, or emerge with 'FEATURES=userpriv'!"
454 - fi
455 -
456 - # CK_FORK=no to avoid using fork() in check library
457 - # as mc mocks fork() itself: bug #644462.
458 - #
459 - # VERBOSE=1 to make test failures contain detailed
460 - # information.
461 - CK_FORK=no emake check VERBOSE=1
462 -}
463 -
464 -src_install() {
465 - emake DESTDIR="${D}" install
466 - dodoc AUTHORS README NEWS
467 -
468 - # fix bug #334383
469 - if use kernel_linux && [[ ${EUID} == 0 ]] ; then
470 - fowners root:tty /usr/libexec/mc/cons.saver
471 - fperms g+s /usr/libexec/mc/cons.saver
472 - fi
473 -
474 - if ! use xdg ; then
475 - sed 's@MC_XDG_OPEN="xdg-open"@MC_XDG_OPEN="/bin/false"@' \
476 - -i "${ED}"/usr/libexec/mc/ext.d/*.sh || die
477 - fi
478 -}
479 -
480 -pkg_postinst() {
481 - if use spell && ! has_version app-dicts/aspell-en ; then
482 - elog "'spell' USE flag is enabled however app-dicts/aspell-en is not installed."
483 - elog "You should manually set 'spell_language' in the Misc section of ~/.config/mc/ini"
484 - elog "It has to be set to one of your installed aspell dictionaries or 'NONE'"
485 - elog
486 - fi
487 -
488 - elog "To enable exiting to latest working directory,"
489 - elog "put this into your ~/.bashrc:"
490 - elog ". ${EPREFIX}/usr/libexec/mc/mc.sh"
491 -}