summaryrefslogtreecommitdiff
path: root/app-misc/screen
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-03-03 10:28:17 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-03-03 10:28:17 +0000
commitd99093fb4bb5652015c06274d64083daa2439e4f (patch)
treecf61513204d97974179580065e85df5c8009087c /app-misc/screen
parent463397cf1e064185110fe57c568d73f99a06f5d1 (diff)
gentoo resync : 03.03.2021
Diffstat (limited to 'app-misc/screen')
-rw-r--r--app-misc/screen/Manifest2
-rw-r--r--app-misc/screen/files/screen-CVE-2021-26937.patch61
-rw-r--r--app-misc/screen/screen-4.8.0-r2.ebuild159
3 files changed, 222 insertions, 0 deletions
diff --git a/app-misc/screen/Manifest b/app-misc/screen/Manifest
index fa2c11a2f58a..3310a337ccc2 100644
--- a/app-misc/screen/Manifest
+++ b/app-misc/screen/Manifest
@@ -1,7 +1,9 @@
AUX screen-4.3.0-no-utempter.patch 341 BLAKE2B 3339783b3574f82f093c82a613ad18c5c58c184c082c2c311281cdd57e7176abae0f5935466a4a8b4d931d1d1b93d8f0a4e6b558a268553af4a0170061e6ebfe SHA512 f4191ba1ecac3076f958f56309c0a1d523b455fa4e3388f1cfca59c8ccff0afdfb20ef18d54794ba539b2b6d1511ed599dc44787344dc5ccce2902c9b9848155
AUX screen-4.6.2-utmp-exit.patch 1558 BLAKE2B e08e83f8b9f0cd09cd9bad4486a75d71bd899a7917954702ece0837099639079a746138374cbeaf71072cca64ae36a3c2a32250123c6747089e724272227e0dd SHA512 0e7c6c224f6fb8e01650b778cb2b155942752504dc97112d9594b7fa0da1bb8bd828240a2519b1c21f1c162181da89a8daa51ef7f74c8ced0b85cdb3e911a67c
+AUX screen-CVE-2021-26937.patch 1864 BLAKE2B 7425a49e003601f21130cf9c42354aaeb5f3cd639dd274971393420ccf45e8273539ae020f8a1a6e4063e741e75dcbf8cecd4e35b26c6d04ffca108ddea7bd32 SHA512 419f4d10b23369fccdadfb024b6ce268794e7f76188b25dd9051ff8cd6080dc0c70f66b9c2480095d655bb63f20ba1fdfa1ce0c681c9b8aff4d4918764018516
AUX screenrc 10412 BLAKE2B f4866f4a83b22c37484b66e4c7d52ec479fe12ae3e72e5c9e769b1b543ecf04d14ef4339e1c72064741cbf39502ef82d3beb213326a30889f128e135f60bd528 SHA512 06fbec5e28480a2c369330fac0c94faa47e5d28e037d9fefd0cb3e813002c504866dc8ac86872b7ac6f16059a219e396a9c425b578b8afe882153ddb506158f7
DIST screen-4.8.0.tar.gz 854854 BLAKE2B 97ef6f18bf2c63c477260b742ac0b3501f112d380c41ccecc5cf2853db853cc62d4fd6d37edeca35fb41a43b76d98a5cfe160749c992d284f9764b0a0fdcc778 SHA512 770ebaf6ee9be711bcb8a6104b3294f2bf4523dae6683fdc5eac4b3aff7e511be2d922b6b2ad28ec241113c2e4fe0d80f9a482ae1658adc19c8c3a3680caa25c
EBUILD screen-4.8.0-r1.ebuild 4115 BLAKE2B 5d9bff693395a3a104253585b30561dda21444540420a68d74ca7d9ca753d79fbb26f82164bf222a659545dc570189db0641f1437f329edc3066630fb0c69f95 SHA512 60d6fdf67117a025cedd504bc109cb519f96defeb7cdded86b5a473641d89969cbdcd939c51849249dd43e1e24ce07ecefdabf9f74f469bf1458d54defa6317f
+EBUILD screen-4.8.0-r2.ebuild 4166 BLAKE2B 9dd7621f5f1d3e2431053a694eb7ddfd4a0cf6218e627d8f41d39a93cae8c4201aea726eaea189d0f997a084a00b3f6a462328f13f57be3a85e3b8a111b5835d SHA512 68eef9c4e34fb49de5f5654c4a067e7fb3be3244424773fc83d259d38114db5d83875b61c6b8a355a47c291128a5a5b27be693453a14467b74dd2aac63646f00
EBUILD screen-9999.ebuild 4221 BLAKE2B b3156a67b9708e22c231e902ee005bf034c118cf610f5461b6408d17694601bb00e4b3aaccc670247aae6b762241e6375324db184cd1410fc3baca8a5bf22e13 SHA512 a8b839ebdbc262851c3725c7099bc85b444b8b00ed40badba7c240a5810eeb22aa0714971b2f116e1860de2c1204b403ffe3bda1200e86ecad2dd5c667a98ba3
MISC metadata.xml 1782 BLAKE2B bb6d45dd49af2c1abcaf4801d509421a885cd9c636c44e71964962abbd111a54505cd3dcdc594479489b943714a4b534332eb4aa1c5a43d0d679a18866983920 SHA512 d12c60725b314af0ea8ea909d387699e18da8a742036c35f2822235536b6787595ec5acaa8b7e1af0a429e0eb618051e62ba937dcf53a245ae804c3ace29d47b
diff --git a/app-misc/screen/files/screen-CVE-2021-26937.patch b/app-misc/screen/files/screen-CVE-2021-26937.patch
new file mode 100644
index 000000000000..9556278274e8
--- /dev/null
+++ b/app-misc/screen/files/screen-CVE-2021-26937.patch
@@ -0,0 +1,61 @@
+ encoding.c | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+diff --git i/encoding.c w/encoding.c
+index e5db3e7..79f5d14 100644
+--- i/encoding.c
++++ w/encoding.c
+@@ -43,7 +43,7 @@ static int encmatch __P((char *, char *));
+ # ifdef UTF8
+ static int recode_char __P((int, int, int));
+ static int recode_char_to_encoding __P((int, int));
+-static void comb_tofront __P((int, int));
++static void comb_tofront __P((int));
+ # ifdef DW_CHARS
+ static int recode_char_dw __P((int, int *, int, int));
+ static int recode_char_dw_to_encoding __P((int, int *, int));
+@@ -1263,6 +1263,8 @@ int c;
+ {0x30000, 0x3FFFD},
+ };
+
++ if (c >= 0xdf00 && c <= 0xdfff)
++ return 1; /* dw combining sequence */
+ return ((bisearch(c, wide, sizeof(wide) / sizeof(struct interval) - 1)) ||
+ (cjkwidth &&
+ bisearch(c, ambiguous,
+@@ -1330,11 +1332,12 @@ int c;
+ }
+
+ static void
+-comb_tofront(root, i)
+-int root, i;
++comb_tofront(i)
++int i;
+ {
+ for (;;)
+ {
++ int root = i >= 0x700 ? 0x801 : 0x800;
+ debug1("bring to front: %x\n", i);
+ combchars[combchars[i]->prev]->next = combchars[i]->next;
+ combchars[combchars[i]->next]->prev = combchars[i]->prev;
+@@ -1396,9 +1399,9 @@ struct mchar *mc;
+ {
+ /* full, recycle old entry */
+ if (c1 >= 0xd800 && c1 < 0xe000)
+- comb_tofront(root, c1 - 0xd800);
++ comb_tofront(c1 - 0xd800);
+ i = combchars[root]->prev;
+- if (c1 == i + 0xd800)
++ if (i == 0x800 || i == 0x801 || c1 == i + 0xd800)
+ {
+ /* completely full, can't recycle */
+ debug("utf8_handle_comp: completely full!\n");
+@@ -1422,7 +1425,7 @@ struct mchar *mc;
+ mc->font = (i >> 8) + 0xd8;
+ mc->fontx = 0;
+ debug3("combinig char %x %x -> %x\n", c1, c, i + 0xd800);
+- comb_tofront(root, i);
++ comb_tofront(i);
+ }
+
+ #else /* !UTF8 */
diff --git a/app-misc/screen/screen-4.8.0-r2.ebuild b/app-misc/screen/screen-4.8.0-r2.ebuild
new file mode 100644
index 000000000000..e5fef8fffeab
--- /dev/null
+++ b/app-misc/screen/screen-4.8.0-r2.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic pam tmpfiles toolchain-funcs
+
+DESCRIPTION="screen manager with VT100/ANSI terminal emulation"
+HOMEPAGE="https://www.gnu.org/software/screen/"
+
+if [[ "${PV}" != 9999 ]] ; then
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+else
+ inherit git-r3
+ EGIT_REPO_URI="https://git.savannah.gnu.org/git/screen.git"
+ EGIT_CHECKOUT_DIR="${WORKDIR}/${P}" # needed for setting S later on
+ S="${WORKDIR}"/${P}/src
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="debug nethack pam selinux multiuser"
+
+CDEPEND="
+ >=sys-libs/ncurses-5.2:0=
+ pam? ( sys-libs/pam )"
+RDEPEND="${CDEPEND}
+ acct-group/utmp
+ selinux? ( sec-policy/selinux-screen )"
+DEPEND="${CDEPEND}
+ sys-apps/texinfo"
+
+PATCHES=(
+ # Don't use utempter even if it is found on the system.
+ "${FILESDIR}"/${PN}-4.3.0-no-utempter.patch
+ "${FILESDIR}"/${PN}-4.6.2-utmp-exit.patch
+ "${FILESDIR}"/${PN}-CVE-2021-26937.patch
+)
+
+src_prepare() {
+ default
+
+ # sched.h is a system header and causes problems with some C libraries
+ mv sched.h _sched.h || die
+ sed -i '/include/ s:sched.h:_sched.h:' screen.h || die
+
+ # Fix manpage.
+ sed -i \
+ -e "s:/usr/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
+ -e "s:/usr/local/screens:${EPREFIX}/tmp/screen:g" \
+ -e "s:/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
+ -e "s:/etc/utmp:${EPREFIX}/var/run/utmp:g" \
+ -e "s:/local/screens/S\\\-:${EPREFIX}/tmp/screen/S\\\-:g" \
+ doc/screen.1 || die
+
+ if [[ ${CHOST} == *-darwin* ]] || use elibc_musl ; then
+ sed -i -e '/^#define UTMPOK/s/define/undef/' acconfig.h || die
+ fi
+
+ # disable musl dummy headers for utmp[x]
+ use elibc_musl && append-cppflags "-D_UTMP_H -D_UTMPX_H"
+
+ # reconfigure
+ eautoreconf
+}
+
+src_configure() {
+ append-cppflags "-DMAXWIN=${MAX_SCREEN_WINDOWS:-100}"
+
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ # enable msg_header by upping the feature standard compatible
+ # with c99 mode
+ append-cppflags -D_XOPEN_SOURCE=600
+ fi
+
+ use nethack || append-cppflags "-DNONETHACK"
+ use debug && append-cppflags "-DDEBUG"
+
+ local myeconfargs=(
+ --with-socket-dir="${EPREFIX}/tmp/${PN}"
+ --with-sys-screenrc="${EPREFIX}/etc/screenrc"
+ --with-pty-mode=0620
+ --with-pty-group=5
+ --enable-rxvt_osc
+ --enable-telnet
+ --enable-colors256
+ $(use_enable pam)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ LC_ALL=POSIX emake comm.h term.h
+ emake osdef.h
+
+ emake -C doc screen.info
+ default
+}
+
+src_install() {
+ local DOCS=(
+ README ChangeLog INSTALL TODO NEWS* patchlevel.h
+ doc/{FAQ,README.DOTSCREEN,fdpat.ps,window_to_display.ps}
+ )
+
+ emake DESTDIR="${D}" SCREEN="${P}" install
+
+ local tmpfiles_perms tmpfiles_group
+
+ if use multiuser || use prefix ; then
+ fperms 4755 /usr/bin/${P}
+ tmpfiles_perms="0755"
+ tmpfiles_group="root"
+ else
+ fowners root:utmp /usr/bin/${P}
+ fperms 2755 /usr/bin/${P}
+ tmpfiles_perms="0775"
+ tmpfiles_group="utmp"
+ fi
+
+ newtmpfiles - screen.conf <<<"d /tmp/screen ${tmpfiles_perms} root ${tmpfiles_group}"
+
+ insinto /usr/share/${PN}
+ doins terminfo/{screencap,screeninfo.src}
+
+ insinto /etc
+ doins "${FILESDIR}"/screenrc
+
+ if use pam; then
+ pamd_mimic_system screen auth
+ fi
+
+ dodoc "${DOCS[@]}"
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSIONS} ]]
+ then
+ elog "Some dangerous key bindings have been removed or changed to more safe values."
+ elog "We enable some xterm hacks in our default screenrc, which might break some"
+ elog "applications. Please check /etc/screenrc for information on these changes."
+ fi
+
+ # Add /tmp/screen in case it doesn't exist yet. This should solve
+ # problems like bug #508634 where tmpfiles.d isn't in effect.
+ local rundir="${EROOT}/tmp/${PN}"
+ if [[ ! -d ${rundir} ]] ; then
+ if use multiuser || use prefix ; then
+ tmpfiles_group="root"
+ else
+ tmpfiles_group="utmp"
+ fi
+ mkdir -m 0775 "${rundir}"
+ chgrp ${tmpfiles_group} "${rundir}"
+ fi
+
+ ewarn "This revision changes the screen socket location to ${rundir}"
+}