summaryrefslogtreecommitdiff
path: root/app-misc/screen
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-09-10 04:41:31 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-09-10 04:41:31 +0100
commitb9baffd9af9383cc886b1583814fe15163017d80 (patch)
treeac23c3bc28a85762e2792dcfd19921f08931a33e /app-misc/screen
parentf848d5eacad65f1f52c168d9b0f74dec3e89b203 (diff)
gentoo auto-resync : 10:09:2022 - 04:41:30
Diffstat (limited to 'app-misc/screen')
-rw-r--r--app-misc/screen/Manifest2
-rw-r--r--app-misc/screen/files/screen-4.9.0-configure-implicit-function-decls.patch745
-rw-r--r--app-misc/screen/screen-4.9.0-r1.ebuild146
3 files changed, 893 insertions, 0 deletions
diff --git a/app-misc/screen/Manifest b/app-misc/screen/Manifest
index 712ff8df2c77..177cbc670f16 100644
--- a/app-misc/screen/Manifest
+++ b/app-misc/screen/Manifest
@@ -1,11 +1,13 @@
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-4.9.0-configure-implicit-function-decls.patch 16578 BLAKE2B 633070a619a45d23f4b2ff4e58fc626e50eefddc11778a68a9bc0da67d60127bc2a0fe8fb6f398b7e9e81b0876733e52127f2ef746171d87122dee24d3a341ac SHA512 c08ae0f2f7015f627486a95fd30e9ce9bf7fd843d520a05213dbe22b97208d10b7212fba7ac9c9ef47b61d8fab96c555909f9a9257ba971f03ae4bd2739e4bf3
AUX screen-9999-no-utempter.patch 465 BLAKE2B be4d690d2f478a2660cb3c0b0f83d9a62328b82b06b85860a84e1b3a924c751080d7e9f35c4b48c3fe6a0152ae75df1dc665b97f8bc70e026bbadd19d4891df1 SHA512 c011936e35e04e7704b0d8d7892f2ebe22fb6993241e7c4b6733e48f6400ca8aeb20c638108018fab006e402332460e89d321e2118f564316e3f7e26a05212d2
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
DIST screen-4.9.0.tar.gz 798229 BLAKE2B 0f64a14ce9a719bd4a6d045c55069769045a09ee2086c44c2e3d9da6d1e5ada2f094e00e16029767e1155ce35d4f360d0e2879995eefa052f3214ced71b7617c SHA512 18bbb085d77ecd02cbc02fa88a945c39f06e0c6de4eeaa16b278440dac5c9896811abbe0838144e997cd344ae08b9530399fa8fcb31a65fc571ead90e8307f84
EBUILD screen-4.8.0-r3.ebuild 3848 BLAKE2B e861b10538b50fa4d53a9b42fc3e69409c2a9d6e24d4f757b9905fc2f48b2ebcc94066f7c7b25f5dfc0c6661b696ca878b9a4a8fce694ed847e6e0eab2095112 SHA512 5c51dde15eeab2e1f0dbf3120ee20cdc1ec22666ad62bf4b86a9db85793d1293673071d2a5cb620726abbba6b2318f172248d381383338b23ba89f1e03cbef3b
+EBUILD screen-4.9.0-r1.ebuild 3851 BLAKE2B 5a85d371d6fb07207d883fa1324094f605114af99c017fb95cd3ff1bfe5d37ba3f0a659e7b98129bf680546514fe6891362369a8ba8e93e1794e0524b2c6bbd0 SHA512 a258bc64578d2189003c1f6d9cd24e5025983cb70c6da9332c654d0a7a5331a434f56c14e336480d9f5f03d040094d7e0f01a4c00498403718ea8a45c3e71111
EBUILD screen-4.9.0.ebuild 3776 BLAKE2B 3a633a10f4ce16e6a98ce539679e6466f41e2edab285caea9bb8d51706d657df7e31d03639bdd9d87a77af7cfc2d308a64a72800371076ba66b981bf942547b6 SHA512 9b8d81c3652eac5342823c27e3199a873031bb8c54182ff3432d631e6f363322a71973b9d58610e93aeca9f040f30f06a3e4592d573146ea826c3f05d13db9e2
EBUILD screen-9999.ebuild 3781 BLAKE2B c70c76d9f0d0f1ea8f7af9d182e22dcb381d9e0ef0f134b27e72e07a3be90e387efe0856dff3459ce04e125dd0e555e83df1e5e32c93bce84ccb7a6b1ee7f6cd SHA512 b503a8ebfdef364fed0acbac79f0960969c668b68243c337ed12a814e7b796cec4235a4faa2c6bae84cb20d6d866547aa3e2b1d4dd242be328cbda43a9c7f188
MISC metadata.xml 1783 BLAKE2B 6b1b392339f6786f95c151a7f311c24adf76c32d23e0f5bf50ff97571ab7e0a7b878d1ccac6938a01c2783c4f54eb0644dfd1f35b9bc602590fce96eed4a4e99 SHA512 fc4a716f118ab74b7757035ffadaaeebd47ba512a8ff123a7f5df4fa8fd2b384a66d4da88f8b78e7c16314b710e2346cfa6fc644c22f059d065cc1778565d060
diff --git a/app-misc/screen/files/screen-4.9.0-configure-implicit-function-decls.patch b/app-misc/screen/files/screen-4.9.0-configure-implicit-function-decls.patch
new file mode 100644
index 000000000000..e9db7ba786aa
--- /dev/null
+++ b/app-misc/screen/files/screen-4.9.0-configure-implicit-function-decls.patch
@@ -0,0 +1,745 @@
+https://bugs.gentoo.org/869371
+--- a/configure.ac
++++ b/configure.ac
+@@ -157,10 +157,11 @@ if test -n "$ULTRIX"; then
+ fi
+ AC_CHECKING(for POSIX.1)
+ AC_EGREP_CPP(YES_IS_DEFINED,
+ [#include <sys/types.h>
+ #include <unistd.h>
++int
+ main () {
+ #ifdef _POSIX_VERSION
+ YES_IS_DEFINED;
+ #endif
+ ], AC_NOTE(- you have a POSIX system) AC_DEFINE(POSIX) posix=1)
+@@ -231,10 +232,11 @@ dnl
+
+ AC_CHECKING(BSD job jontrol)
+ AC_TRY_LINK(
+ [#include <sys/types.h>
+ #include <sys/ioctl.h>
++#include <unistd.h>
+ ], [
+ #ifdef POSIX
+ tcsetpgrp(0, 0);
+ #else
+ int x = TIOCSPGRP;
+@@ -248,48 +250,64 @@ int y = TIOCNOTTY;
+
+ dnl
+ dnl **** setresuid(), setreuid(), seteuid() ****
+ dnl
+ AC_CHECKING(setresuid)
+-AC_TRY_LINK(,[
++AC_TRY_LINK(
++[#include <unistd.h>
++], [
+ setresuid(0, 0, 0);
+ ], AC_DEFINE(HAVE_SETRESUID))
+ AC_CHECKING(setreuid)
+-AC_TRY_LINK(,[
++AC_TRY_LINK(
++[#include <unistd.h>
++], [
+ setreuid(0, 0);
+ ], AC_DEFINE(HAVE_SETREUID))
+ dnl
+ dnl seteuid() check:
+ dnl linux seteuid was broken before V1.1.11
+ dnl NeXT, AUX, ISC, and ultrix are still broken (no saved uid support)
+ dnl Solaris seteuid doesn't change the saved uid, bad for
+ dnl multiuser screen sessions
+ AC_CHECKING(seteuid)
+-AC_TRY_LINK(,[
++AC_TRY_LINK(
++[#include <unistd.h>
++],[
+ #if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(sun) && defined(SVR4)) || defined(ISC) || defined(sony_news)
+-seteuid_is_broken(0);
++int seteuid_is_broken(int); seteuid_is_broken(0);
+ #else
+ seteuid(0);
+ #endif
+ ], AC_DEFINE(HAVE_SETEUID))
+
+ dnl execvpe
+ AC_CHECKING(execvpe)
+-AC_TRY_LINK(,[
++AC_TRY_LINK(
++[#include <unistd.h>
++],[
+ execvpe(0, 0, 0);
+ ], AC_DEFINE(HAVE_EXECVPE)
+ CFLAGS="$CFLAGS -D_GNU_SOURCE")
+
+ dnl
+ dnl **** select() ****
+ dnl
+
+ AC_CHECKING(select)
+-AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],,
++AC_TRY_LINK(
++[#include <sys/select.h>
++],[
++ select(0, 0, 0, 0, 0);
++],,
+ LIBS="$LIBS -lnet -lnsl"
+ AC_CHECKING(select with $LIBS)
+-AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],,
++AC_TRY_LINK(
++[#include <sys/select.h>
++],[
++ select(0, 0, 0, 0, 0);
++],,
+ AC_MSG_ERROR(!!! no select - no screen))
+ )
+ dnl
+ dnl **** FIFO tests ****
+ dnl
+@@ -314,11 +332,11 @@ AC_TRY_RUN([
+ #define S_IFIFO 0010000
+ #endif
+
+ char *fin = "/tmp/conftest$$";
+
+-main()
++int main()
+ {
+ struct stat stb;
+ fd_set f;
+
+ (void)alarm(5);
+@@ -326,40 +344,40 @@ main()
+ #ifdef POSIX
+ if (mkfifo(fin, 0777))
+ #else
+ if (mknod(fin, S_IFIFO|0777, 0))
+ #endif
+- exit(1);
++ return 1;
+ if (stat(fin, &stb) || (stb.st_mode & S_IFIFO) != S_IFIFO)
+- exit(1);
++ return 1;
+ close(0);
+ #ifdef __386BSD__
+ /*
+ * The next test fails under 386BSD, but screen works using fifos.
+ * Fifos in O_RDWR mode are only used for the BROKEN_PIPE case and for
+ * the select() configuration test.
+ */
+- exit(0);
++ return 0;
+ #endif
+ if (open(fin, O_RDONLY | O_NONBLOCK))
+- exit(1);
++ return 1;
+ if (fork() == 0)
+ {
+ close(0);
+ if (open(fin, O_WRONLY | O_NONBLOCK))
+- exit(1);
++ return 1;
+ close(0);
+ if (open(fin, O_WRONLY | O_NONBLOCK))
+- exit(1);
++ return 1;
+ if (write(0, "TEST", 4) == -1)
+- exit(1);
+- exit(0);
++ return 1;
++ return 0;
+ }
+ FD_SET(0, &f);
+ if (select(1, &f, 0, 0, 0) == -1)
+- exit(1);
+- exit(0);
++ return 1;
++ return 0;
+ }
+ ], AC_NOTE(- your fifos are usable) fifo=1,
+ AC_NOTE(- your fifos are not usable),
+ AC_NOTE(- skipping check because we are cross compiling; assuming fifos are usable) fifo=1)
+ rm -f /tmp/conftest*
+@@ -385,30 +403,31 @@ AC_TRY_RUN([
+ #define S_IFIFO 0010000
+ #endif
+
+ char *fin = "/tmp/conftest$$";
+
++int
+ main()
+ {
+ struct timeval tv;
+ fd_set f;
+
+ #ifdef POSIX
+ if (mkfifo(fin, 0600))
+ #else
+ if (mknod(fin, S_IFIFO|0600, 0))
+ #endif
+- exit(1);
++ return 1;
+ close(0);
+ if (open(fin, O_RDONLY|O_NONBLOCK))
+- exit(1);
++ return 1;
+ FD_SET(0, &f);
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
+ if (select(1, &f, 0, 0, &tv))
+- exit(1);
+- exit(0);
++ return 1;
++ return 0;
+ }
+ ], AC_NOTE(- your implementation is ok),
+ AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1,
+ AC_NOTE(- skipping check because we are cross compiling; assuming fifo implementation is ok))
+ rm -f /tmp/conftest*
+@@ -432,46 +455,48 @@ AC_TRY_RUN([
+
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
++#include <signal.h>
+
+ char *son = "/tmp/conftest$$";
+
++int
+ main()
+ {
+ int s1, s2, l;
+ struct sockaddr_un a;
+ fd_set f;
+
+ (void)alarm(5);
+ if ((s1 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
+- exit(1);
++ return 1;
+ a.sun_family = AF_UNIX;
+ strcpy(a.sun_path, son);
+ (void) unlink(son);
+ if (bind(s1, (struct sockaddr *) &a, strlen(son)+2) == -1)
+- exit(1);
++ return 1;
+ if (listen(s1, 2))
+- exit(1);
++ return 1;
+ if (fork() == 0)
+ {
+ if ((s2 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
+ kill(getppid(), 3);
+ (void)connect(s2, (struct sockaddr *)&a, strlen(son) + 2);
+ if (write(s2, "HELLO", 5) == -1)
+ kill(getppid(), 3);
+- exit(0);
++ return 0;
+ }
+ l = sizeof(a);
+ close(0);
+ if (accept(s1, &a, &l))
+- exit(1);
++ return 1;
+ FD_SET(0, &f);
+ if (select(1, &f, 0, 0, 0) == -1)
+- exit(1);
+- exit(0);
++ return 1;
++ return 0;
+ }
+ ], AC_NOTE(- your sockets are usable) sock=1,
+ AC_NOTE(- your sockets are not usable),
+ AC_NOTE(- skipping check because we are cross compiling; assuming sockets are usable) sock=1)
+ rm -f /tmp/conftest*
+@@ -491,26 +516,27 @@ AC_TRY_RUN([
+ #include <sys/socket.h>
+ #include <sys/un.h>
+
+ char *son = "/tmp/conftest$$";
+
++int
+ main()
+ {
+ int s;
+ struct stat stb;
+ struct sockaddr_un a;
+ if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
+- exit(0);
++ return 0;
+ a.sun_family = AF_UNIX;
+ strcpy(a.sun_path, son);
+ (void) unlink(son);
+ if (bind(s, (struct sockaddr *) &a, strlen(son)+2) == -1)
+- exit(0);
++ return 0;
+ if (stat(son, &stb))
+- exit(1);
++ return 1;
+ close(s);
+- exit(0);
++ return 0;
+ }
+ ],AC_NOTE(- you are normal),
+ AC_NOTE(- unix domain sockets are not kept in the filesystem)
+ AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1,
+ AC_NOTE(- skipping check because we are cross compiling; assuming sockets are normal))
+@@ -545,122 +571,167 @@ char *nam = "/tmp/conftest$$";
+ #endif
+ #ifndef S_IFIFO
+ #define S_IFIFO 0010000
+ #endif
+
++int
+ main()
+ {
+ fd_set f;
+
+ #ifdef __FreeBSD__
+ /* From Andrew A. Chernov (ache@astral.msk.su):
+ * opening RDWR fifo fails in BSD 4.4, but select return values are
+ * right.
+ */
+- exit(0);
++ return 0;
+ #endif
+ (void)alarm(5);
+ #ifdef POSIX
+ if (mkfifo(nam, 0777))
+ #else
+ if (mknod(nam, S_IFIFO|0777, 0))
+ #endif
+- exit(1);
++ return 1;
+ close(0);
+ if (open(nam, O_RDWR | O_NONBLOCK))
+- exit(1);
++ return 1;
+ if (write(0, "TEST", 4) == -1)
+- exit(1);
++ return 1;
+
+ #else
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
++#include <signal.h>
+
++int
+ main()
+ {
+ int s1, s2, l;
+ struct sockaddr_un a;
+ fd_set f;
+
+ (void)alarm(5);
+ if ((s1 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
+- exit(1);
++ return 1;
+ a.sun_family = AF_UNIX;
+ strcpy(a.sun_path, nam);
+ (void) unlink(nam);
+ if (bind(s1, (struct sockaddr *) &a, strlen(nam)+2) == -1)
+- exit(1);
++ return 1;
+ if (listen(s1, 2))
+- exit(1);
++ return 1;
+ if (fork() == 0)
+ {
+ if ((s2 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
+ kill(getppid(), 3);
+ (void)connect(s2, (struct sockaddr *)&a, strlen(nam) + 2);
+ if (write(s2, "HELLO", 5) == -1)
+ kill(getppid(), 3);
+- exit(0);
++ return 0;
+ }
+ l = sizeof(a);
+ close(0);
+ if (accept(s1, (struct sockaddr *)&a, &l))
+- exit(1);
++ return 1;
+ #endif
+
+
+ FD_SET(0, &f);
+ if (select(1, &f, 0, 0, 0) == -1)
+- exit(1);
++ return 1;
+ if (select(1, &f, &f, 0, 0) != 2)
+- exit(1);
+- exit(0);
++ return 1;
++ return 0;
+ }
+ ],AC_NOTE(- select is ok),
+ AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN),
+ AC_NOTE(- skipping check because we are cross compiling; assuming select is ok))
+
+ dnl
+ dnl **** termcap or terminfo ****
+ dnl
+ AC_CHECKING(for tgetent)
+-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
++AC_TRY_LINK([
++ #include <curses.h>
++ #include <term.h>
++], [
++ tgetent((char *)0, (char *)0);
++],,
+ olibs="$LIBS"
+ LIBS="-lcurses $olibs"
+ AC_CHECKING(libcurses)
+-AC_TRY_LINK(,[
++AC_TRY_LINK([#include <curses.h>
++ #include <term.h>
++],[
+ #ifdef __hpux
+ __sorry_hpux_libcurses_is_totally_broken_in_10_10();
+ #else
+ tgetent((char *)0, (char *)0);
+ #endif
+ ],,
+ LIBS="-ltermcap $olibs"
+ AC_CHECKING(libtermcap)
+-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
++AC_TRY_LINK(
++[#include <curses.h>
++ #include <term.h>
++],[
++ tgetent((char *)0, (char *)0);
++],,
+ LIBS="-ltermlib $olibs"
+ AC_CHECKING(libtermlib)
+-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
++AC_TRY_LINK(
++[#include <curses.h>
++ #include <term.h>
++],[
++ tgetent((char *)0, (char *)0);
++],,
+ LIBS="-lncursesw $olibs"
+ AC_CHECKING(libncursesw)
+-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
++AC_TRY_LINK(
++[#include <curses.h>
++ #include <term.h>
++],[
++ tgetent((char *)0, (char *)0);
++],,
+ LIBS="-ltinfow $olibs"
+ AC_CHECKING(libtinfow)
+-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
++AC_TRY_LINK(
++[#include <curses.h>
++ #include <term.h>
++],[
++ tgetent((char *)0, (char *)0);
++],,
+ LIBS="-lncurses $olibs"
+ AC_CHECKING(libncurses)
+-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
++AC_TRY_LINK(
++[#include <curses.h>
++ #include <term.h>
++],[
++ tgetent((char *)0, (char *)0);
++],,
+ LIBS="-ltinfo $olibs"
+ AC_CHECKING(libtinfo)
+-AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
++AC_TRY_LINK(
++[#include <curses.h>
++ #include <term.h>
++],[
++ tgetent((char *)0, (char *)0);
++],,
+ AC_MSG_ERROR(!!! no tgetent - no screen)))))))))
+
+ AC_TRY_RUN([
++#include <curses.h>
++#include <string.h>
++#include <term.h>
++
++int
+ main()
+ {
+- exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
++ return(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
+ }], AC_NOTE(- you use the termcap database),
+ AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO),
+ AC_NOTE(- skipping check because we are cross compiling; assuming terminfo database is used) AC_DEFINE(TERMINFO))
+ AC_CHECKING(ospeed)
+ AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
+@@ -677,11 +748,15 @@ fi
+
+ if test "$cross_compiling" = no ; then
+ AC_CHECKING(for SVR4 ptys)
+ sysvr4ptys=
+ if test -c /dev/ptmx ; then
+-AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS)
++AC_TRY_LINK([
++ #include <stdlib.h>
++], [
++ ptsname(0);grantpt(0);unlockpt(0);
++],[AC_DEFINE(HAVE_SVR4_PTYS)
+ sysvr4ptys=1])
+ fi
+ fi
+
+ AC_CHECK_FUNCS(getpt)
+@@ -733,33 +808,36 @@ AC_CHECKING(default tty permissions/group)
+ rm -f conftest_grp
+ AC_TRY_RUN([
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++int
+ main()
+ {
+ struct stat sb;
+ char *x,*ttyname();
+ int om, m;
+ FILE *fp;
+
+- if (!(x = ttyname(0))) exit(1);
+- if (stat(x, &sb)) exit(1);
++ if (!(x = ttyname(0))) return 1;
++ if (stat(x, &sb)) return 1;
+ om = sb.st_mode;
+- if (om & 002) exit(0);
++ if (om & 002) return 0;
+ m = system("mesg y");
+- if (m == -1 || m == 127) exit(1);
+- if (stat(x, &sb)) exit(1);
++ if (m == -1 || m == 127) return 1;
++ if (stat(x, &sb)) return 1;
+ m = sb.st_mode;
+- if (chmod(x, om)) exit(1);
+- if (m & 002) exit(0);
+- if (sb.st_gid == getgid()) exit(1);
++ if (chmod(x, om)) return 1;
++ if (m & 002) return 0;
++ if (sb.st_gid == getgid()) return 1;
+ if (!(fp=fopen("conftest_grp", "w")))
+- exit(1);
++ return 1;
+ fprintf(fp, "%d\n", sb.st_gid);
+ fclose(fp);
+- exit(0);
++ return 0;
+ }
+ ],[
+ if test -f conftest_grp; then
+ ptygrp=`cat conftest_grp`
+ AC_NOTE([- pty mode: $ptymode, group: $ptygrp])
+@@ -869,17 +942,25 @@ AC_CHECKING(for libutil(s))
+ test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils"
+ test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
+ fi
+
+ AC_CHECKING(getloadavg)
+-AC_TRY_LINK(,[getloadavg((double *)0, 0);],
++AC_TRY_LINK(
++[
++ #include <stdlib.h>
++],[
++ getloadavg((double *)0, 0);],
+ AC_DEFINE(LOADAV_GETLOADAVG) load=1,
+ if test "$cross_compiling" = no && test -f /usr/lib/libkvm.a ; then
+ olibs="$LIBS"
+ LIBS="$LIBS -lkvm"
+ AC_CHECKING(getloadavg with -lkvm)
+-AC_TRY_LINK(,[getloadavg((double *)0, 0);],
++AC_TRY_LINK(
++[
++ #include <stdlib.h>
++],[
++ getloadavg((double *)0, 0);],
+ AC_DEFINE(LOADAV_GETLOADAVG) load=1, LIBS="$olibs")
+ fi
+ )
+
+ if test -z "$load" ; then
+@@ -931,10 +1012,11 @@ else
+
+ $nlist64
+
+ struct nlist nl[2];
+
++int
+ main()
+ {
+ #if !defined(_AUX_SOURCE) && !defined(AUX)
+ # ifdef NLIST_NAME_UNION
+ nl[0].n_un.n_name = "$av";
+@@ -944,12 +1026,12 @@ main()
+ #else
+ strncpy(nl[0].n_name, "$av", sizeof(nl[0].n_name));
+ #endif
+ nlist(LOADAV_UNIX, nl);
+ if (nl[0].n_value == 0)
+- exit(1);
+- exit(0);
++ return 1;
++ return 0;
+ }
+ ],avensym=$av;break)
+ if test "$av" = _Loadavg; then
+ nlist64='#define nlist nlist64'
+ fi
+@@ -1068,21 +1150,22 @@ void
+ hand()
+ {
+ got++;
+ }
+
++int
+ main()
+ {
+ /* on hpux we use sigvec to get bsd signals */
+ #ifdef __hpux
+ (void)signal(SIGCLD, hand);
+ kill(getpid(), SIGCLD);
+ kill(getpid(), SIGCLD);
+ if (got < 2)
+- exit(1);
++ return 1;
+ #endif
+- exit(0);
++ return 0;
+ }
+ ],,AC_DEFINE(SYSVSIGS),:)
+
+ fi
+
+@@ -1107,14 +1190,22 @@ oldlibs="$LIBS"
+ LIBS="$LIBS -lsun"
+ AC_CHECKING(IRIX sun library)
+ AC_TRY_LINK(,,,LIBS="$oldlibs")
+
+ AC_CHECKING(syslog)
+-AC_TRY_LINK(,[closelog();], , [oldlibs="$LIBS"
++AC_TRY_LINK(
++[#include <syslog.h>
++], [
++ closelog();
++], , [oldlibs="$LIBS"
+ LIBS="$LIBS -lbsd"
+ AC_CHECKING(syslog in libbsd.a)
+-AC_TRY_LINK(, [closelog();], AC_NOTE(- found.), [LIBS="$oldlibs"
++AC_TRY_LINK(
++[#include <syslog.h>
++], [
++ closelog();
++], AC_NOTE(- found.), [LIBS="$oldlibs"
+ AC_NOTE(- bad news: syslog missing.) AC_DEFINE(NOSYSLOG)])])
+
+ AC_EGREP_CPP(YES_IS_DEFINED,
+ [#ifdef M_UNIX
+ YES_IS_DEFINED;
+@@ -1147,66 +1238,87 @@ fi
+ dnl AC_CHECK_HEADER(shadow.h, AC_DEFINE(SHADOWPW))
+ AC_CHECKING(getspnam)
+ AC_TRY_LINK([#include <shadow.h>], [getspnam("x");],AC_DEFINE(SHADOWPW))
+
+ AC_CHECKING(getttyent)
+-AC_TRY_LINK(,[getttyent();], AC_DEFINE(GETTTYENT))
++AC_TRY_LINK(
++[
++ #include <ttyent.h>
++],[
++ getttyent();
++], AC_DEFINE(GETTTYENT))
+
+ AC_CHECKING(fdwalk)
+ AC_TRY_LINK([#include <stdlib.h>], [fdwalk(NULL, NULL);],AC_DEFINE(HAVE_FDWALK))
+
+ AC_CHECKING(whether memcpy/memmove/bcopy handles overlapping arguments)
+ AC_TRY_RUN([
++#include <string.h>
++
++int
+ main() {
+ char buf[10];
+ strcpy(buf, "abcdefghi");
+ bcopy(buf, buf + 2, 3);
+ if (strncmp(buf, "ababcf", 6))
+- exit(1);
++ return 1;
+ strcpy(buf, "abcdefghi");
+ bcopy(buf + 2, buf, 3);
+ if (strncmp(buf, "cdedef", 6))
+- exit(1);
+- exit(0); /* libc version works properly. */
++ return 1;
++ return 0; /* libc version works properly. */
+ }], AC_DEFINE(USEBCOPY),,:)
+
+ AC_TRY_RUN([
++#include <string.h>
++
+ #define bcopy(s,d,l) memmove(d,s,l)
++int
+ main() {
+ char buf[10];
+ strcpy(buf, "abcdefghi");
+ bcopy(buf, buf + 2, 3);
+ if (strncmp(buf, "ababcf", 6))
+- exit(1);
++ return 1;
+ strcpy(buf, "abcdefghi");
+ bcopy(buf + 2, buf, 3);
+ if (strncmp(buf, "cdedef", 6))
+- exit(1);
+- exit(0); /* libc version works properly. */
++ return 1;
++ return 0; /* libc version works properly. */
+ }], AC_DEFINE(USEMEMMOVE),,
+ AC_NOTE(- skipping check because we are cross compiling; use memmove) AC_DEFINE(USEMEMMOVE))
+
+
+ AC_TRY_RUN([
++#include <string.h>
++
+ #define bcopy(s,d,l) memcpy(d,s,l)
++int
+ main() {
+ char buf[10];
+ strcpy(buf, "abcdefghi");
+ bcopy(buf, buf + 2, 3);
+ if (strncmp(buf, "ababcf", 6))
+- exit(1);
++ return 1;
+ strcpy(buf, "abcdefghi");
+ bcopy(buf + 2, buf, 3);
+ if (strncmp(buf, "cdedef", 6))
+- exit(1);
+- exit(0); /* libc version works properly. */
++ return 1;
++ return 0; /* libc version works properly. */
+ }], AC_DEFINE(USEMEMCPY),,:)
+
+ AC_SYS_LONG_FILE_NAMES
+
+ AC_MSG_CHECKING(for vsprintf)
+-AC_TRY_LINK([#include <stdarg.h>],[va_list valist; vsprintf(0,0,valist);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
++AC_TRY_LINK(
++[
++ #include <stdarg.h>
++ #include <stdio.h>
++],
++[
++ va_list valist; vsprintf(0,0,valist);
++], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
+
+ AC_HEADER_DIRENT
+
+ AC_MSG_CHECKING(for setenv)
+ if test -z "$ac_setenv_args"; then
+
diff --git a/app-misc/screen/screen-4.9.0-r1.ebuild b/app-misc/screen/screen-4.9.0-r1.ebuild
new file mode 100644
index 000000000000..44eb81d05d0d
--- /dev/null
+++ b/app-misc/screen/screen-4.9.0-r1.ebuild
@@ -0,0 +1,146 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic pam tmpfiles
+
+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 ~loong ~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"
+
+DEPEND=">=sys-libs/ncurses-5.2:=
+ virtual/libcrypt:=
+ pam? ( sys-libs/pam )"
+RDEPEND="${DEPEND}
+ acct-group/utmp
+ selinux? ( sec-policy/selinux-screen )"
+BDEPEND="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}-4.9.0-configure-implicit-function-decls.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
+
+ tmpfiles_process screen.conf
+
+ ewarn "This revision changes the screen socket location to ${EROOT}/tmp/${PN}"
+}