Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,31 @@
This fixes
../screen-4.6.2/pty.c: In function 'OpenPTY':
../screen-4.6.2/pty.c:328:7: warning: implicit declaration of function 'openpty'; did you mean 'openat'? [-Wimplicit-function-declaration]
if (openpty(&f, &s, TtyName, NULL, NULL) != 0)
^~~~~~~
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Upstream-Status: Backport
---
pty.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/pty.c b/pty.c
index 1c0660e..502338f 100644
--- a/pty.c
+++ b/pty.c
@@ -47,11 +47,7 @@
# include <sys/ttold.h>
#endif
-#ifdef ISC
-# include <sys/tty.h>
-# include <sys/sioctl.h>
-# include <sys/pty.h>
-#endif
+#include <pty.h>
#ifdef sgi
# include <sys/sysmacros.h>
@@ -0,0 +1,151 @@
From 4e102de2e6204c1d8e8be00bb5ffd4587e70350c Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 15 Aug 2022 10:35:53 -0700
Subject: [PATCH] configure: Add needed system headers in checks
Newer compilers throw warnings when a funciton is used with implicit
declaration and enabling -Werror can silently fail these tests and
result in wrong configure results. Therefore add the needed headers in
the AC_TRY_LINK macros
* configure.ac: Add missing system headers in AC_TRY_LINK.
Upstream-Status: Submitted [https://lists.gnu.org/archive/html/screen-devel/2022-08/msg00000.html]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.ac | 57 +++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 43 insertions(+), 14 deletions(-)
diff --git a/configure.ac b/configure.ac
index c0f02df..d308079 100644
--- a/configure.ac
+++ b/configure.ac
@@ -233,6 +233,7 @@ AC_CHECKING(BSD job jontrol)
AC_TRY_LINK(
[#include <sys/types.h>
#include <sys/ioctl.h>
+#include <unistd.h>
], [
#ifdef POSIX
tcsetpgrp(0, 0);
@@ -250,12 +251,16 @@ dnl
dnl **** setresuid(), setreuid(), seteuid() ****
dnl
AC_CHECKING(setresuid)
-AC_TRY_LINK(,[
-setresuid(0, 0, 0);
+AC_TRY_LINK([
+#include <unistd.h>
+],[
+return setresuid(0, 0, 0);
], AC_DEFINE(HAVE_SETRESUID))
AC_CHECKING(setreuid)
-AC_TRY_LINK(,[
-setreuid(0, 0);
+AC_TRY_LINK([
+#include <unistd.h>
+],[
+return setreuid(0, 0);
], AC_DEFINE(HAVE_SETREUID))
dnl
dnl seteuid() check:
@@ -274,7 +279,9 @@ seteuid(0);
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")
@@ -284,10 +291,18 @@ 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
@@ -624,11 +639,19 @@ 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
@@ -871,7 +894,7 @@ 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"
@@ -1109,10 +1132,10 @@ 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,
@@ -1149,7 +1172,7 @@ 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))
@@ -1204,7 +1227,13 @@ main() {
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
@@ -0,0 +1,58 @@
From 79ad2885e26631077dd6b8aebe17ae95b38133a6 Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Tue, 26 Jul 2016 14:23:59 +0800
Subject: [PATCH] fix for multijob build
make sure that comm.sh script generates comm.h header before doing
anything else
Signed-off-by: Amadeusz Sawiski <amade@asmblr.net>
Upstream-Status: Backport
Backport patch to fix parallel build failure and update context to make patch
coulde be applied.
http://git.savannah.gnu.org/cgit/screen.git/commit?id=c0de6dd
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
Makefile.in | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index aca7da3..3607711 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -298,7 +298,7 @@ search.o: layout.h viewport.h canvas.h search.c config.h screen.h os.h osdef.h a
comm.h layer.h term.h image.h display.h window.h mark.h extern.h
tty.o: layout.h viewport.h canvas.h tty.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
layer.h term.h image.h display.h window.h extern.h
-term.o: layout.h viewport.h canvas.h term.c term.h
+term.o: layout.h viewport.h canvas.h term.c term.h comm.h
window.o: layout.h viewport.h canvas.h window.c config.h screen.h os.h osdef.h ansi.h acls.h \
comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
utmp.o: layout.h viewport.h canvas.h utmp.c config.h screen.h os.h osdef.h ansi.h acls.h \
@@ -324,7 +324,7 @@ canvas.o: layout.h viewport.h canvas.h canvas.c config.h screen.h os.h osdef.h a
comm.h layer.h term.h image.h display.h window.h extern.h \
braille.h
comm.o: layout.h viewport.h canvas.h comm.c config.h acls.h comm.h
-kmapdef.o: layout.h viewport.h canvas.h kmapdef.c config.h
+kmapdef.o: layout.h viewport.h canvas.h kmapdef.c config.h comm.h
acls.o: layout.h viewport.h canvas.h acls.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
layer.h term.h image.h display.h window.h extern.h
braille.o: layout.h viewport.h canvas.h braille.c config.h screen.h os.h osdef.h ansi.h acls.h \
@@ -350,7 +350,7 @@ layout.o: layout.h viewport.h canvas.h layout.c config.h screen.h os.h osdef.h a
viewport.o: layout.h viewport.h canvas.h viewport.c config.h screen.h os.h osdef.h ansi.h acls.h \
comm.h layer.h term.h image.h display.h window.h extern.h \
braille.h
-list_generic.o: list_generic.h list_generic.c layer.h screen.h osdef.h
-list_display.o: list_generic.h list_display.c layer.h screen.h osdef.h
+list_generic.o: list_generic.h list_generic.c layer.h screen.h osdef.h comm.h
+list_display.o: list_generic.h list_display.c layer.h screen.h osdef.h comm.h
list_window.o: list_generic.h list_window.c window.h layer.h screen.h osdef.h comm.h
--
1.9.1
@@ -0,0 +1,30 @@
Upstream-Status: Backport
Backport from:
http://git.savannah.gnu.org/cgit/screen.git/commit/?id=39c5f1c
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
From 39c5f1c76f1fcef4b5958bf828a63f53426b6984 Mon Sep 17 00:00:00 2001
From: Mike Gerwitz <mike@mikegerwitz.com>
Date: Tue, 24 Dec 2013 22:16:31 -0500
Subject: [PATCH] comm.h now depends on term.h
---
src/Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: screen-4.6.1/Makefile.in
===================================================================
--- screen-4.6.1.orig/Makefile.in
+++ screen-4.6.1/Makefile.in
@@ -133,7 +133,7 @@ kmapdef.c: term.h
tty.c: tty.sh
sh $(srcdir)/tty.sh tty.c
-comm.h: comm.c comm.sh config.h
+comm.h: comm.c comm.sh config.h term.h
AWK=$(AWK) CC="$(CC) $(CFLAGS)" srcdir=${srcdir} sh $(srcdir)/comm.sh
osdef.h: osdef.sh config.h osdef.h.in
@@ -0,0 +1,2 @@
#%PAM-1.0
auth include common-auth
@@ -0,0 +1,40 @@
From e9ad41bfedb4537a6f0de20f00b27c7739f168f7 Mon Sep 17 00:00:00 2001
From: Alexander Naumov <alexander_naumov@opensuse.org>
Date: Mon, 30 Jan 2023 17:22:25 +0200
Subject: fix: missing signal sending permission check on failed query messages
Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org>
CVE: CVE-2023-24626
Upstream-Status: Backport
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
src/socket.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/socket.c b/src/socket.c
index 147dc54..54d8cb8 100644
--- a/socket.c
+++ b/socket.c
@@ -1285,11 +1285,16 @@ ReceiveMsg()
else
queryflag = -1;
- Kill(m.m.command.apid,
+ if (CheckPid(m.m.command.apid)) {
+ Msg(0, "Query attempt with bad pid(%d)!", m.m.command.apid);
+ }
+ else {
+ Kill(m.m.command.apid,
(queryflag >= 0)
? SIGCONT
: SIG_BYE); /* Send SIG_BYE if an error happened */
- queryflag = -1;
+ queryflag = -1;
+ }
}
break;
case MSG_COMMAND:
--
cgit v1.1
@@ -0,0 +1,51 @@
SUMMARY = "Multiplexing terminal manager"
DESCRIPTION = "Screen is a full-screen window manager \
that multiplexes a physical terminal between several \
processes, typically interactive shells."
HOMEPAGE = "http://www.gnu.org/software/screen/"
BUGTRACKER = "https://savannah.gnu.org/bugs/?func=additem&group=screen"
SECTION = "console/utils"
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
file://screen.h;endline=26;md5=b8dc717c9a3dba842ae6c44ca0f73f52 \
"
DEPENDS = "ncurses virtual/crypt \
${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
RDEPENDS:${PN} = "base-files"
SRC_URI = "${GNU_MIRROR}/screen/screen-${PV}.tar.gz \
${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'file://screen.pam', '', d)} \
file://0002-comm.h-now-depends-on-term.h.patch \
file://0001-fix-for-multijob-build.patch \
file://0001-Remove-more-compatibility-stuff.patch \
file://0001-configure-Add-needed-system-headers-in-checks.patch \
file://signal-permission.patch \
"
SRC_URI[sha256sum] = "f9335281bb4d1538ed078df78a20c2f39d3af9a4e91c57d084271e0289c730f4"
inherit autotools texinfo
PACKAGECONFIG ??= ""
PACKAGECONFIG[utempter] = "ac_cv_header_utempter_h=yes,ac_cv_header_utempter_h=no,libutempter,"
EXTRA_OECONF = "--with-pty-mode=0620 --with-pty-group=5 --with-sys-screenrc=${sysconfdir}/screenrc \
${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}"
do_install:append () {
install -D -m 644 ${S}/etc/etcscreenrc ${D}/${sysconfdir}/screenrc
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
install -D -m 644 ${WORKDIR}/screen.pam ${D}/${sysconfdir}/pam.d/screen
fi
}
pkg_postinst:${PN} () {
grep -q "^${bindir}/screen$" $D${sysconfdir}/shells || echo ${bindir}/screen >> $D${sysconfdir}/shells
}
pkg_postrm:${PN} () {
printf "$(grep -v "^${bindir}/screen$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
}