sysutils/screen49: Remove expired port
2025-05-31 sysutils/screen49: Multiple CVEs
This commit is contained in:
parent
0708111995
commit
b1ec099e21
1
MOVED
1
MOVED
@ -4427,3 +4427,4 @@ www/py-dj50-django-taggit|www/py-dj51-django-taggit|2025-06-01|Has expired: Exte
|
||||
www/py-dj50-strawberry-graphql-django|www/py-dj51-strawberry-graphql-django|2025-06-01|Has expired: Extended support of Django 5.0 ends April 2025, upgrade to the Django 5.1+ version of this port. See https://www.djangoproject.com/download/
|
||||
devel/py-dj50-strawberry-graphql|devel/py-dj51-strawberry-graphql|2025-06-01|Has expired: Extended support of Django 5.0 ends April 2025, upgrade to the Django 5.1+ version of this port. See https://www.djangoproject.com/download/
|
||||
www/py-dj50-channels|www/py-dj51-channels|2025-06-01|Has expired: Extended support of Django 5.0 ends April 2025, upgrade to the Django 5.1+ version of this port. See https://www.djangoproject.com/download/
|
||||
sysutils/screen49||2025-06-01|Has expired: Multiple CVEs
|
||||
|
||||
@ -1264,7 +1264,6 @@
|
||||
SUBDIR += schilyutils
|
||||
SUBDIR += screen
|
||||
SUBDIR += screen-devel
|
||||
SUBDIR += screen49
|
||||
SUBDIR += screen50
|
||||
SUBDIR += screenfetch
|
||||
SUBDIR += screenie
|
||||
|
||||
@ -1,126 +0,0 @@
|
||||
PORTNAME= screen
|
||||
PORTVERSION= 4.9.1
|
||||
PORTREVISION= 6
|
||||
CATEGORIES= sysutils
|
||||
MASTER_SITES= GNU \
|
||||
ftp://ftp.gnu.org/gnu/screen/ \
|
||||
ftp://gnu.mirror.iweb.com/screen/ \
|
||||
http://gnu.mirror.iweb.com/screen/ \
|
||||
http://mirror.sdunix.com/gnu/ \
|
||||
ftp://mirrors.kernel.org/gnu/screen/ \
|
||||
http://cschubert.com/distfiles/ \
|
||||
LOCAL/cy
|
||||
.if !defined(MASTERDIR)
|
||||
PKGNAMESUFFIX= 49
|
||||
CONFLICTS= screen-*
|
||||
.endif
|
||||
|
||||
MAINTAINER= cy@FreeBSD.org
|
||||
COMMENT= Multi-screen window manager
|
||||
WWW= https://www.gnu.org/software/screen/
|
||||
|
||||
CONFLICTS+= screen-devel*
|
||||
|
||||
DEPRECATED= Multiple CVEs
|
||||
EXPIRATION_DATE=2025-05-31
|
||||
|
||||
LICENSE= GPLv3
|
||||
|
||||
OPTIONS_DEFINE= INFO NETHACK XTERM_256 SYSTEM_SCREENRC MULTIUSER \
|
||||
NOSOCKETDIR
|
||||
OPTIONS_DEFAULT= INFO NETHACK XTERM_256 SOCKETS SYSTEM_SCREENRC \
|
||||
NCURSES_DEFAULT MULTIUSER
|
||||
OPTIONS_SINGLE= IPC NCURSES
|
||||
OPTIONS_SINGLE_IPC= SOCKETS NAMED_PIPES
|
||||
OPTIONS_SINGLE_NCURSES= NCURSES_DEFAULT NCURSES_BASE NCURSES_PORT
|
||||
NETHACK_DESC= Enable nethack-style messages
|
||||
XTERM_256_DESC= Enable support for 256 colour xterm
|
||||
SOCKETS_DESC= Use new (4.2.1+) sockets for IPC (default)
|
||||
NAMED_PIPES_DESC= Use legacy (4.0.3) named pipes for IPC (override)
|
||||
SYSTEM_SCREENRC_DESC= Install system screenrc with helpful status line
|
||||
MULTIUSER_DESC= Install setuid-root screen to support multiuser
|
||||
MULTIUSER_PLIST_SUB= MULTISUID="@(,,4555) "
|
||||
MULTIUSER_PLIST_SUB_OFF=MULTISUID="@(,,0555) "
|
||||
NCURSES_DEFAULT_DESC= Depend on ncurses (ports if installed, otherwise base)
|
||||
NCURSES_BASE_DESC= Depend on ncurses in base
|
||||
NCURSES_PORT_DESC= Depend on devel/ncurses in ports
|
||||
NOSOCKETDIR_DESC= Use ~/.screen instead of socketdir
|
||||
|
||||
NCURSES_DEFAULT_USES= ncurses
|
||||
NCURSES_BASE_USES= ncurses:base
|
||||
NCURSES_PORT_USES= ncurses:port
|
||||
|
||||
OPTIONS_SUB=
|
||||
|
||||
USES= autoreconf:build gmake cpe
|
||||
MAKE_ARGS+= WITH_MAN=1
|
||||
|
||||
CPE_VENDOR= gnu
|
||||
|
||||
.include <bsd.port.options.mk>
|
||||
|
||||
GNU_CONFIGURE= yes
|
||||
GNU_CONFIGURE_MANPREFIX= ${PREFIX}/share
|
||||
CFLAGS+= -I${NCURSESINC}
|
||||
LDFLAGS+= -L${NCURSESLIB}
|
||||
|
||||
.if ${PORT_OPTIONS:MINFO}
|
||||
INFO= screen
|
||||
MAKE_ARGS+= WITH_INFO=1
|
||||
USES+= makeinfo
|
||||
.endif
|
||||
|
||||
# Enables support for 256 colour xterm. Note that you may need to
|
||||
# set up a custom termcap entry or .screenrc which modifies termcap
|
||||
# to contain the following: Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm
|
||||
#
|
||||
.if ${PORT_OPTIONS:MXTERM_256}
|
||||
CFLAGS+= -DCOLORS256
|
||||
.endif
|
||||
|
||||
.if ! ${PORT_OPTIONS:MNETHACK}
|
||||
CFLAGS+= -DNONETHACK
|
||||
.endif
|
||||
|
||||
.if ${PORT_OPTIONS:MNOSOCKETDIR}
|
||||
CONFIGURE_ARGS+= --disable-socket-dir
|
||||
.endif
|
||||
|
||||
.if defined(SCREEN_SOCKET_DIR)
|
||||
CONFIGURE_ARGS+= --with-socket-dir=${SCREEN_SOCKET_DIR}
|
||||
.endif
|
||||
|
||||
post-patch:
|
||||
@${RM} ${WRKSRC}/doc/screen.info*
|
||||
|
||||
# Bug 191029: Users can choose whether to use sockets or named pipes.
|
||||
# Choose sockets if you don't know what the difference is.
|
||||
# Choose named pipes if your environment is heterogeneous,
|
||||
# using both screen 4.0.3 and 4.2.1.
|
||||
# Bug 191017
|
||||
|
||||
pre-configure:
|
||||
cd ${WRKSRC} && ./autogen.sh
|
||||
|
||||
post-configure-NAMED_PIPES-on:
|
||||
@${ECHO_CMD} '#define NAMEDPIPE 1' >> ${WRKSRC}/config.h
|
||||
@${ECHO_CMD} User selected named pipes override set.
|
||||
|
||||
ETCDIR?= ${PREFIX}/etc
|
||||
|
||||
post-install:
|
||||
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
|
||||
${INSTALL_DATA} ${WRKSRC}/etc/etcscreenrc \
|
||||
${STAGEDIR}${EXAMPLESDIR}/screenrc.sample-1
|
||||
${INSTALL_DATA} ${FILESDIR}/screenrc.sample \
|
||||
${STAGEDIR}${EXAMPLESDIR}/screenrc.sample-2
|
||||
@${MKDIR} ${STAGEDIR}${ETCDIR}
|
||||
.if ${PORT_OPTIONS:MSYSTEM_SCREENRC}
|
||||
${INSTALL_DATA} ${FILESDIR}/screenrc.sample \
|
||||
${STAGEDIR}${ETCDIR}/screenrc.sample
|
||||
.else
|
||||
${INSTALL_DATA} ${WRKSRC}/etc/etcscreenrc \
|
||||
${STAGEDIR}${ETCDIR}/screenrc.sample
|
||||
.endif
|
||||
|
||||
.include <bsd.port.mk>
|
||||
@ -1,3 +0,0 @@
|
||||
TIMESTAMP = 1692454303
|
||||
SHA256 (screen-4.9.1.tar.gz) = 26cef3e3c42571c0d484ad6faf110c5c15091fbf872b06fa7aa4766c7405ac69
|
||||
SIZE (screen-4.9.1.tar.gz) = 1040785
|
||||
@ -1,93 +0,0 @@
|
||||
--- attacher.c.orig 2023-08-16 00:29:26 UTC
|
||||
+++ attacher.c
|
||||
@@ -73,7 +73,6 @@ extern int multiattach, multi_uid, own_uid;
|
||||
#ifdef MULTIUSER
|
||||
extern char *multi;
|
||||
extern int multiattach, multi_uid, own_uid;
|
||||
-extern int tty_mode, tty_oldmode;
|
||||
# ifndef USE_SETEUID
|
||||
static int multipipe[2];
|
||||
# endif
|
||||
@@ -160,9 +159,6 @@ int how;
|
||||
|
||||
if (pipe(multipipe))
|
||||
Panic(errno, "pipe");
|
||||
- if (chmod(attach_tty, 0666))
|
||||
- Panic(errno, "chmod %s", attach_tty);
|
||||
- tty_oldmode = tty_mode;
|
||||
eff_uid = -1; /* make UserContext fork */
|
||||
real_uid = multi_uid;
|
||||
if ((ret = UserContext()) <= 0)
|
||||
@@ -174,11 +170,6 @@ int how;
|
||||
Panic(errno, "UserContext");
|
||||
close(multipipe[1]);
|
||||
read(multipipe[0], &dummy, 1);
|
||||
- if (tty_oldmode >= 0)
|
||||
- {
|
||||
- chmod(attach_tty, tty_oldmode);
|
||||
- tty_oldmode = -1;
|
||||
- }
|
||||
ret = UserStatus();
|
||||
#ifdef LOCK
|
||||
if (ret == SIG_LOCK)
|
||||
@@ -224,9 +215,6 @@ int how;
|
||||
xseteuid(multi_uid);
|
||||
xseteuid(own_uid);
|
||||
#endif
|
||||
- if (chmod(attach_tty, 0666))
|
||||
- Panic(errno, "chmod %s", attach_tty);
|
||||
- tty_oldmode = tty_mode;
|
||||
}
|
||||
# endif /* USE_SETEUID */
|
||||
#endif /* MULTIUSER */
|
||||
@@ -423,13 +411,6 @@ int how;
|
||||
ContinuePlease = 0;
|
||||
# ifndef USE_SETEUID
|
||||
close(multipipe[1]);
|
||||
-# else
|
||||
- xseteuid(own_uid);
|
||||
- if (tty_oldmode >= 0)
|
||||
- if (chmod(attach_tty, tty_oldmode))
|
||||
- Panic(errno, "chmod %s", attach_tty);
|
||||
- tty_oldmode = -1;
|
||||
- xseteuid(real_uid);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
@@ -505,14 +486,6 @@ AttacherFinit SIGDEFARG
|
||||
close(s);
|
||||
}
|
||||
}
|
||||
-#ifdef MULTIUSER
|
||||
- if (tty_oldmode >= 0)
|
||||
- {
|
||||
- if (setuid(own_uid))
|
||||
- Panic(errno, "setuid");
|
||||
- chmod(attach_tty, tty_oldmode);
|
||||
- }
|
||||
-#endif
|
||||
exit(0);
|
||||
SIGRETURN;
|
||||
}
|
||||
@@ -732,7 +705,7 @@ LockTerminal()
|
||||
printf("\n");
|
||||
|
||||
prg = getenv("LOCKPRG");
|
||||
- if (prg && strcmp(prg, "builtin") && !access(prg, X_OK))
|
||||
+ if (prg && (strcmp(prg, "builtin") || strcmp(prg,"builtin-passwd")) && !access(prg, X_OK))
|
||||
{
|
||||
signal(SIGCHLD, SIG_DFL);
|
||||
debug1("lockterminal: '%s' seems executable, execl it!\n", prg);
|
||||
@@ -751,7 +724,11 @@ LockTerminal()
|
||||
Panic(errno, "setuid");
|
||||
#endif
|
||||
closeallfiles(0); /* important: /etc/shadow may be open */
|
||||
- execl(prg, "SCREEN-LOCK", NULL);
|
||||
+ if (strcmp(prg,"builtin-passwd"))
|
||||
+ /* use system passsword for lock */
|
||||
+ execl(prg, "SCREEN-LOCK", "-p", "-n", NULL);
|
||||
+ else
|
||||
+ execl(prg, "SCREEN-LOCK", NULL);
|
||||
exit(errno);
|
||||
}
|
||||
if (pid == -1)
|
||||
@ -1,75 +0,0 @@
|
||||
--- configure.ac.orig 2023-08-16 00:29:26 UTC
|
||||
+++ configure.ac
|
||||
@@ -669,7 +669,7 @@ olibs="$LIBS"
|
||||
tgetent((char *)0, (char *)0);
|
||||
],,
|
||||
olibs="$LIBS"
|
||||
-LIBS="-lcurses $olibs"
|
||||
+LIBS="-lcurses $olibs"; CC="$CC -I/usr/local/include"
|
||||
AC_CHECKING(libcurses)
|
||||
AC_TRY_LINK([
|
||||
#include <curses.h>
|
||||
@@ -756,19 +756,6 @@ fi
|
||||
fi
|
||||
fi
|
||||
|
||||
-if test "$cross_compiling" = no ; then
|
||||
-AC_CHECKING(for SVR4 ptys)
|
||||
-sysvr4ptys=
|
||||
-if test -c /dev/ptmx ; then
|
||||
-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)
|
||||
|
||||
dnl check for openpty()
|
||||
@@ -900,11 +887,11 @@ dnl
|
||||
dnl
|
||||
dnl **** utmp handling ****
|
||||
dnl
|
||||
-AC_CHECKING(getutent)
|
||||
+AC_CHECKING(getutxent)
|
||||
AC_TRY_LINK([
|
||||
#include <time.h> /* to get time_t on SCO */
|
||||
#include <sys/types.h>
|
||||
-#if defined(SVR4) && !defined(DGUX)
|
||||
+#if defined(SVR4) && !defined(DGUX) || defined(__FreeBSD__)
|
||||
#include <utmpx.h>
|
||||
#define utmp utmpx
|
||||
#else
|
||||
@@ -917,11 +904,11 @@ LIBS="$LIBS -lgen"
|
||||
[int x = DEAD_PROCESS; pututline((struct utmp *)0); getutent();], AC_DEFINE(GETUTENT),
|
||||
olibs="$LIBS"
|
||||
LIBS="$LIBS -lgen"
|
||||
-AC_CHECKING(getutent with -lgen)
|
||||
+AC_CHECKING(getutxent with -lgen)
|
||||
AC_TRY_LINK([
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
-#if defined(SVR4) && !defined(DGUX)
|
||||
+#if defined(SVR4) && !defined(DGUX) || defined(__FreeBSD__)
|
||||
#include <utmpx.h>
|
||||
#define utmp utmpx
|
||||
#else
|
||||
@@ -931,13 +918,13 @@ AC_TRY_LINK([
|
||||
#define pututline _pututline
|
||||
#endif
|
||||
],
|
||||
-[int x = DEAD_PROCESS; pututline((struct utmp *)0); getutent();], AC_DEFINE(GETUTENT), LIBS="$olibs")
|
||||
+[int x = DEAD_PROCESS; pututxline((struct utmp *)0); getutxent();], AC_DEFINE(GETUTENT), LIBS="$olibs")
|
||||
)
|
||||
AC_CHECKING(ut_host)
|
||||
AC_TRY_COMPILE([
|
||||
#include <time.h>
|
||||
#include <sys/types.h>
|
||||
-#if defined(SVR4) && !defined(DGUX)
|
||||
+#if defined(SVR4) && !defined(DGUX) || defined(__FreeBSD__)
|
||||
#include <utmpx.h>
|
||||
#define utmp utmpx
|
||||
#else
|
||||
@ -1,34 +0,0 @@
|
||||
--- doc/Makefile.in.orig 2023-08-16 00:29:26 UTC
|
||||
+++ doc/Makefile.in
|
||||
@@ -31,7 +31,10 @@ install: installdirs
|
||||
$(MAKEINFO) $(srcdir)/screen.texinfo -o screen.info
|
||||
|
||||
install: installdirs
|
||||
+ifeq (${WITH_MAN},1)
|
||||
$(INSTALL_DATA) $(srcdir)/screen.1 $(DESTDIR)$(mandir)/man1/screen.1
|
||||
+endif
|
||||
+ifeq (${WITH_INFO},1)
|
||||
-$(MAKE) screen.info
|
||||
-if test -f screen.info; then d=.; else d=$(srcdir); fi; \
|
||||
if test -f $$d/screen.info; then \
|
||||
@@ -40,13 +43,19 @@ install: installdirs
|
||||
install-info --info-dir=$(DESTDIR)$(infodir) $$d/screen.info; \
|
||||
else true; fi; \
|
||||
fi
|
||||
+endif
|
||||
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(mandir)/man1/screen.1
|
||||
rm -f $(DESTDIR)$(infodir)/screen.info*
|
||||
|
||||
installdirs:
|
||||
- $(srcdir)/../etc/mkinstalldirs $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(infodir)
|
||||
+ifeq (${WITH_MAN},1)
|
||||
+ $(srcdir)/../etc/mkinstalldirs $(DESTDIR)$(mandir)/man1
|
||||
+endif
|
||||
+ifeq (${WITH_INFO},1)
|
||||
+ $(srcdir)/../etc/mkinstalldirs $(DESTDIR)$(infodir)
|
||||
+endif
|
||||
|
||||
mostlyclean:
|
||||
-rm -f *.cp *.cps *.fn *.fns *.ky *.kys *.pg *.tp *.vr
|
||||
@ -1,11 +0,0 @@
|
||||
--- doc/screen.1.orig 2023-08-15 11:01:59 UTC
|
||||
+++ doc/screen.1
|
||||
@@ -241,7 +241,7 @@
|
||||
.IR screen ,
|
||||
but prints a list of
|
||||
.I pid.tty.host
|
||||
-strings identifying your
|
||||
+strings and creation timestamps identifying your
|
||||
.I screen
|
||||
sessions.
|
||||
Sessions marked `detached' can be resumed with \*Qscreen \-r\*U. Those marked
|
||||
@ -1,8 +0,0 @@
|
||||
--- extern.h.orig 2023-08-15 08:44:47 UTC
|
||||
+++ extern.h
|
||||
@@ -512,3 +512,5 @@
|
||||
/* layout.c */
|
||||
extern void RemoveLayout __P((struct layout *));
|
||||
extern int LayoutDumpCanvas __P((struct canvas *, char *));
|
||||
+
|
||||
+extern time_t SessionCreationTime __P((const char *));
|
||||
@ -1,31 +0,0 @@
|
||||
--- misc.c.orig 2023-08-16 00:29:26 UTC
|
||||
+++ misc.c
|
||||
@@ -28,8 +28,10 @@
|
||||
|
||||
#include <poll.h>
|
||||
#include <sys/types.h>
|
||||
+#include <sys/user.h>
|
||||
#include <sys/stat.h> /* mkdir() declaration */
|
||||
#include <signal.h>
|
||||
+#include <libutil.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "screen.h"
|
||||
@@ -720,3 +722,17 @@ xvsnprintf(char *s, int n, char *fmt, xva_list stack)
|
||||
}
|
||||
|
||||
#endif
|
||||
+
|
||||
+time_t
|
||||
+SessionCreationTime(fifo)
|
||||
+const char *fifo;
|
||||
+{
|
||||
+ int pid = atoi(fifo);
|
||||
+ if (pid <= 0) return 0;
|
||||
+
|
||||
+ struct kinfo_proc * kip = kinfo_getproc(pid);
|
||||
+ if (kip == 0) return 0;
|
||||
+ time_t start = kip->ki_start.tv_sec;
|
||||
+ free (kip);
|
||||
+ return start;
|
||||
+}
|
||||
@ -1,33 +0,0 @@
|
||||
--- os.h.orig 2023-08-16 00:29:26 UTC
|
||||
+++ os.h
|
||||
@@ -250,9 +250,11 @@ extern int errno;
|
||||
#endif
|
||||
|
||||
#if defined(UTMPOK) || defined(BUGGYGETLOGIN)
|
||||
-# if defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux)
|
||||
+# if (defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux)) || defined(__FreeBSD_version)
|
||||
# include <utmpx.h>
|
||||
-# define UTMPFILE UTMPX_FILE
|
||||
+# ifdef UTMPX_FILE /* GNU extension */
|
||||
+# define UTMPFILE UTMPX_FILE
|
||||
+# endif
|
||||
# define utmp utmpx
|
||||
# define getutent getutxent
|
||||
# define getutid getutxid
|
||||
@@ -507,7 +509,7 @@ typedef struct fd_set { int fds_bits[1]; } fd_set;
|
||||
*/
|
||||
|
||||
#ifndef TERMCAP_BUFSIZE
|
||||
-# define TERMCAP_BUFSIZE 1023
|
||||
+# define TERMCAP_BUFSIZE 1024
|
||||
#endif
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
@@ -524,6 +526,6 @@ typedef struct fd_set { int fds_bits[1]; } fd_set;
|
||||
/* Changing those you won't be able to attach to your old sessions
|
||||
* when changing those values in official tree don't forget to bump
|
||||
* MSG_VERSION */
|
||||
-#define MAXTERMLEN 32
|
||||
+#define MAXTERMLEN 63
|
||||
#define MAXLOGINLEN 256
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
--- osdef.h.in.orig 2023-08-16 00:29:26 UTC
|
||||
+++ osdef.h.in
|
||||
@@ -28,6 +28,8 @@
|
||||
****************************************************************
|
||||
*/
|
||||
|
||||
+#include <sys/param.h>
|
||||
+#if defined(__FreeBSD_version) && __FreeBSD_version < 1500020
|
||||
extern int printf __P((char *, ...));
|
||||
extern int fprintf __P((FILE *, char *, ...));
|
||||
extern int sprintf __P((char *, char *, ...));
|
||||
@@ -71,6 +73,7 @@ extern void bcopy __P((char *, char *, int));
|
||||
#else
|
||||
extern void bcopy __P((char *, char *, int));
|
||||
#endif
|
||||
+#endif /* __FreeBSD_version */
|
||||
|
||||
#ifdef BSDWAIT
|
||||
struct rusage; /* for wait3 __P */
|
||||
@ -1,20 +0,0 @@
|
||||
--- resize.c.orig 2023-08-16 00:29:26 UTC
|
||||
+++ resize.c
|
||||
@@ -683,6 +683,17 @@ int wi, he, hi;
|
||||
he = MAXWIDTH;
|
||||
}
|
||||
|
||||
+ if (wi > 1000)
|
||||
+ {
|
||||
+ Msg(0, "Window width too large, truncated");
|
||||
+ wi = 1000;
|
||||
+ }
|
||||
+ if (he > 1000)
|
||||
+ {
|
||||
+ Msg(0, "Window height too large, truncated");
|
||||
+ he = 1000;
|
||||
+ }
|
||||
+
|
||||
if (p->w_width == wi && p->w_height == he && p->w_histheight == hi)
|
||||
{
|
||||
debug("ChangeWindowSize: No change.\n");
|
||||
@ -1,120 +0,0 @@
|
||||
--- screen.c.orig 2023-08-16 00:29:26 UTC
|
||||
+++ screen.c
|
||||
@@ -230,8 +230,6 @@ int multiattach;
|
||||
int multi_uid;
|
||||
int own_uid;
|
||||
int multiattach;
|
||||
-int tty_mode;
|
||||
-int tty_oldmode = -1;
|
||||
#endif
|
||||
|
||||
char HostName[MAXSTR];
|
||||
@@ -1009,9 +1007,6 @@ int main(int ac, char** av)
|
||||
|
||||
/* ttyname implies isatty */
|
||||
SetTtyname(true, &st);
|
||||
-#ifdef MULTIUSER
|
||||
- tty_mode = (int)st.st_mode & 0777;
|
||||
-#endif
|
||||
|
||||
fl = fcntl(0, F_GETFL, 0);
|
||||
if (fl != -1 && (fl & (O_RDWR|O_RDONLY|O_WRONLY)) == O_RDWR)
|
||||
@@ -1127,15 +1122,28 @@ int main(int ac, char** av)
|
||||
#endif
|
||||
}
|
||||
|
||||
- if (stat(SockPath, &st) == -1)
|
||||
- Panic(errno, "Cannot access %s", SockPath);
|
||||
- else
|
||||
- if (!S_ISDIR(st.st_mode))
|
||||
+ if (stat(SockPath, &st) == -1) {
|
||||
+ if (eff_uid == real_uid) {
|
||||
+ Panic(errno, "Cannot access %s", SockPath);
|
||||
+ } else {
|
||||
+ Panic(0, "Error accessing %s", SockPath);
|
||||
+ }
|
||||
+ } else if (!S_ISDIR(st.st_mode)) {
|
||||
+ if (eff_uid == real_uid || st.st_uid == real_uid) {
|
||||
Panic(0, "%s is not a directory.", SockPath);
|
||||
+ } else {
|
||||
+ Panic(0, "Error accessing %s", SockPath);
|
||||
+ }
|
||||
+ }
|
||||
#ifdef MULTIUSER
|
||||
if (multi) {
|
||||
- if ((int)st.st_uid != multi_uid)
|
||||
- Panic(0, "%s is not the owner of %s.", multi, SockPath);
|
||||
+ if ((int)st.st_uid != multi_uid) {
|
||||
+ if (eff_uid == real_uid || st.st_uid == real_uid) {
|
||||
+ Panic(0, "%s is not the owner of %s.", multi, SockPath);
|
||||
+ } else {
|
||||
+ Panic(0, "Error accessing %s", SockPath);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -1149,9 +1157,13 @@ int main(int ac, char** av)
|
||||
Panic(0, "You are not the owner of %s.", SockPath);
|
||||
#endif
|
||||
}
|
||||
-
|
||||
- if ((st.st_mode & 0777) != 0700)
|
||||
- Panic(0, "Directory %s must have mode 700.", SockPath);
|
||||
+ if ((st.st_mode & 0777) != 0700) {
|
||||
+ if (eff_uid == real_uid || st.st_uid == real_uid) {
|
||||
+ Panic(0, "Directory %s must have mode 700.", SockPath);
|
||||
+ } else {
|
||||
+ Panic(0, "Error accessing %s", SockPath);
|
||||
+ }
|
||||
+ }
|
||||
if (SockMatch && index(SockMatch, '/'))
|
||||
Panic(0, "Bad session name '%s'", SockMatch);
|
||||
SockName = SockPath + strlen(SockPath) + 1;
|
||||
@@ -1189,8 +1201,14 @@ int main(int ac, char** av)
|
||||
else
|
||||
exit(9 + (fo || oth ? 1 : 0) + fo);
|
||||
}
|
||||
- if (fo == 0)
|
||||
- Panic(0, "No Sockets found in %s.\n", SockPath);
|
||||
+ if (fo == 0) {
|
||||
+ if (eff_uid == real_uid || st.st_uid == real_uid) {
|
||||
+ Panic(0, "No Sockets found in %s.\n", SockPath);
|
||||
+ } else {
|
||||
+ Panic(0, "Error accessing %s", SockPath);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
Msg(0, "%d Socket%s in %s.", fo, fo > 1 ? "s" : "", SockPath);
|
||||
eexit(0);
|
||||
}
|
||||
@@ -2170,20 +2188,6 @@ DEFINE_VARARGS_FN(Panic)
|
||||
if (D_userpid)
|
||||
Kill(D_userpid, SIG_BYE);
|
||||
}
|
||||
-#ifdef MULTIUSER
|
||||
- if (tty_oldmode >= 0) {
|
||||
-
|
||||
-# ifdef USE_SETEUID
|
||||
- if (setuid(own_uid))
|
||||
- xseteuid(own_uid); /* may be a loop. sigh. */
|
||||
-# else
|
||||
- setuid(own_uid);
|
||||
-# endif
|
||||
-
|
||||
- debug1("Panic: changing back modes from %s\n", attach_tty);
|
||||
- chmod(attach_tty, tty_oldmode);
|
||||
- }
|
||||
-#endif
|
||||
eexit(1);
|
||||
}
|
||||
|
||||
@@ -2234,7 +2238,7 @@ static char *pad_expand(char *buf, char *p, int numpad
|
||||
pn2 = pn = p + padlen;
|
||||
r = winmsg_numrend;
|
||||
while (p >= buf) {
|
||||
- if (r && *p != 127 && p - buf == winmsg_rendpos[r - 1]) {
|
||||
+ if (r && p - buf == winmsg_rendpos[r - 1]) {
|
||||
winmsg_rendpos[--r] = pn - buf;
|
||||
continue;
|
||||
}
|
||||
@ -1,97 +0,0 @@
|
||||
--- socket.c.orig 2025-05-13 14:58:03 UTC
|
||||
+++ socket.c
|
||||
@@ -171,8 +171,13 @@ bool *is_sock;
|
||||
xsetegid(real_gid);
|
||||
#endif
|
||||
|
||||
- if ((dirp = opendir(SockPath)) == 0)
|
||||
- Panic(errno, "Cannot opendir %s", SockPath);
|
||||
+ if ((dirp = opendir(SockPath)) == 0) {
|
||||
+ if (eff_uid == real_uid) {
|
||||
+ Panic(errno, "Cannot opendir %s", SockPath);
|
||||
+ } else {
|
||||
+ Panic(0, "Error accessing %s", SockPath);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
slist = 0;
|
||||
slisttail = &slist;
|
||||
@@ -841,6 +846,11 @@ int pid;
|
||||
return UserStatus();
|
||||
}
|
||||
|
||||
+static void KillUnpriv(pid_t pid, int sig) {
|
||||
+ UserContext();
|
||||
+ UserReturn(kill(pid, sig));
|
||||
+}
|
||||
+
|
||||
#ifdef hpux
|
||||
/*
|
||||
* From: "F. K. Bruner" <napalm@ugcs.caltech.edu>
|
||||
@@ -926,14 +936,14 @@ struct win *wi;
|
||||
{
|
||||
Msg(errno, "Could not perform necessary sanity checks on pts device.");
|
||||
close(i);
|
||||
- Kill(pid, SIG_BYE);
|
||||
+ KillUnpriv(pid, SIG_BYE);
|
||||
return -1;
|
||||
}
|
||||
if (strcmp(ttyname_in_ns, m->m_tty))
|
||||
{
|
||||
Msg(errno, "Attach: passed fd does not match tty: %s - %s!", ttyname_in_ns, m->m_tty[0] != '\0' ? m->m_tty : "(null)");
|
||||
close(i);
|
||||
- Kill(pid, SIG_BYE);
|
||||
+ KillUnpriv(pid, SIG_BYE);
|
||||
return -1;
|
||||
}
|
||||
/* m->m_tty so far contains the actual name of the pts device in the
|
||||
@@ -950,19 +960,19 @@ struct win *wi;
|
||||
{
|
||||
Msg(errno, "Attach: passed fd does not match tty: %s - %s!", m->m_tty, myttyname ? myttyname : "NULL");
|
||||
close(i);
|
||||
- Kill(pid, SIG_BYE);
|
||||
+ KillUnpriv(pid, SIG_BYE);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if ((i = secopen(m->m_tty, O_RDWR | O_NONBLOCK, 0)) < 0)
|
||||
{
|
||||
Msg(errno, "Attach: Could not open %s!", m->m_tty);
|
||||
- Kill(pid, SIG_BYE);
|
||||
+ KillUnpriv(pid, SIG_BYE);
|
||||
return -1;
|
||||
}
|
||||
#ifdef MULTIUSER
|
||||
if (attach)
|
||||
- Kill(pid, SIGCONT);
|
||||
+ KillUnpriv(pid, SIGCONT);
|
||||
#endif
|
||||
|
||||
#if defined(ultrix) || defined(pyr) || defined(NeXT)
|
||||
@@ -975,7 +985,7 @@ struct win *wi;
|
||||
{
|
||||
write(i, "Attaching from inside of screen?\n", 33);
|
||||
close(i);
|
||||
- Kill(pid, SIG_BYE);
|
||||
+ KillUnpriv(pid, SIG_BYE);
|
||||
Msg(0, "Attach msg ignored: coming from inside.");
|
||||
return -1;
|
||||
}
|
||||
@@ -986,7 +996,7 @@ struct win *wi;
|
||||
{
|
||||
write(i, "Access to session denied.\n", 26);
|
||||
close(i);
|
||||
- Kill(pid, SIG_BYE);
|
||||
+ KillUnpriv(pid, SIG_BYE);
|
||||
Msg(0, "Attach: access denied for user %s.", user);
|
||||
return -1;
|
||||
}
|
||||
@@ -1304,7 +1314,7 @@ ReceiveMsg()
|
||||
Msg(0, "Query attempt with bad pid(%d)!", m.m.command.apid);
|
||||
}
|
||||
else {
|
||||
- Kill(m.m.command.apid,
|
||||
+ KillUnpriv(m.m.command.apid,
|
||||
(queryflag >= 0)
|
||||
? SIGCONT
|
||||
: SIG_BYE); /* Send SIG_BYE if an error happened */
|
||||
@ -1,15 +0,0 @@
|
||||
--- termcap.c.orig 2023-08-16 00:29:26 UTC
|
||||
+++ termcap.c
|
||||
@@ -361,11 +361,7 @@ int he;
|
||||
if (D_CG0)
|
||||
{
|
||||
if (D_CS0 == 0)
|
||||
-#ifdef TERMINFO
|
||||
- D_CS0 = "\033(%p1%c";
|
||||
-#else
|
||||
- D_CS0 = "\033(%.";
|
||||
-#endif
|
||||
+ D_CS0 = "\033(%p1%c"; /* Old ncurses can't handle %. */
|
||||
if (D_CE0 == 0)
|
||||
D_CE0 = "\033(B";
|
||||
D_AC = 0;
|
||||
@ -1,18 +0,0 @@
|
||||
--- terminfo/checktc.c.orig 2023-08-16 00:29:26 UTC
|
||||
+++ terminfo/checktc.c
|
||||
@@ -171,6 +171,7 @@ char *s;
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
+#ifndef __FreeBSD__
|
||||
void CPutStr(s, c)
|
||||
char *s;
|
||||
int c;
|
||||
@@ -178,6 +179,7 @@ int c;
|
||||
tputs(tgoto(s, 0, c), 1, putcha);
|
||||
fflush(stdout);
|
||||
}
|
||||
+#endif /* __FreeBSD__ */
|
||||
|
||||
void CCPutStr(s, x, y)
|
||||
char *s;
|
||||
@ -1,156 +0,0 @@
|
||||
--- utmp.c.orig 2023-08-16 00:29:26 UTC
|
||||
+++ utmp.c
|
||||
@@ -26,6 +26,7 @@
|
||||
****************************************************************
|
||||
*/
|
||||
|
||||
+#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
@@ -89,11 +90,13 @@ static struct utmp *getutslot __P((slot_t));
|
||||
static int pututslot __P((slot_t, struct utmp *, char *, struct win *));
|
||||
static struct utmp *getutslot __P((slot_t));
|
||||
#ifndef GETUTENT
|
||||
+#if 0
|
||||
static struct utmp *getutent __P((void));
|
||||
static void endutent __P((void));
|
||||
static int initutmp __P((void));
|
||||
static void setutent __P((void));
|
||||
#endif
|
||||
+#endif
|
||||
#if defined(linux) && defined(GETUTENT)
|
||||
static struct utmp *xpututline __P((struct utmp *utmp));
|
||||
# define pututline xpututline
|
||||
@@ -102,9 +105,7 @@ static char UtmpName[] = UTMPFILE;
|
||||
|
||||
static int utmpok;
|
||||
static char UtmpName[] = UTMPFILE;
|
||||
-#ifndef UTMP_HELPER
|
||||
static int utmpfd = -1;
|
||||
-#endif
|
||||
|
||||
|
||||
# if defined(GETUTENT) && (!defined(SVR4) || defined(__hpux)) && ! defined(__CYGWIN__)
|
||||
@@ -409,12 +410,6 @@ struct win *wi;
|
||||
register slot_t slot;
|
||||
struct utmp u;
|
||||
int saved_ut;
|
||||
-#ifdef UTHOST
|
||||
- char *p;
|
||||
- char host[sizeof(D_loginhost) + 15];
|
||||
-#else
|
||||
- char *host = 0;
|
||||
-#endif /* UTHOST */
|
||||
|
||||
wi->w_slot = (slot_t)0;
|
||||
if (!utmpok || wi->w_type != W_TYPE_PTY)
|
||||
@@ -435,51 +430,13 @@ struct win *wi;
|
||||
makeuser(&u, stripdev(wi->w_tty), LoginName, wi->w_pid);
|
||||
|
||||
#ifdef UTHOST
|
||||
- host[sizeof(host) - 15] = '\0';
|
||||
- if (display)
|
||||
- {
|
||||
- strncpy(host, D_loginhost, sizeof(host) - 15);
|
||||
- if (D_loginslot != (slot_t)0 && D_loginslot != (slot_t)-1 && host[0] != '\0')
|
||||
- {
|
||||
- /*
|
||||
- * we want to set our ut_host field to something like
|
||||
- * ":ttyhf:s.0" or
|
||||
- * "faui45:s.0" or
|
||||
- * "132.199.81.4:s.0" (even this may hurt..), but not
|
||||
- * "faui45.informati"......:s.0
|
||||
- * HPUX uses host:0.0, so chop at "." and ":" (Eric Backus)
|
||||
- */
|
||||
- for (p = host; *p; p++)
|
||||
- if ((*p < '0' || *p > '9') && (*p != '.'))
|
||||
- break;
|
||||
- if (*p)
|
||||
- {
|
||||
- for (p = host; *p; p++)
|
||||
- if (*p == '.' || (*p == ':' && p != host))
|
||||
- {
|
||||
- *p = '\0';
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- strncpy(host + 1, stripdev(D_usertty), sizeof(host) - 15 - 1);
|
||||
- host[0] = ':';
|
||||
- }
|
||||
- }
|
||||
- else
|
||||
- strncpy(host, "local", sizeof(host) - 15);
|
||||
-
|
||||
- sprintf(host + strlen(host), ":S.%d", wi->w_number);
|
||||
- debug1("rlogin hostname: '%s'\n", host);
|
||||
-
|
||||
# if !defined(_SEQUENT_) && !defined(sequent)
|
||||
- strncpy(u.ut_host, host, sizeof(u.ut_host));
|
||||
+ if (display)
|
||||
+ strncpy(u.ut_host, D_loginhost, sizeof(u.ut_host));
|
||||
# endif
|
||||
#endif /* UTHOST */
|
||||
|
||||
- if (pututslot(slot, &u, host, wi) == 0)
|
||||
+ if (pututslot(slot, &u, D_loginhost, wi) == 0)
|
||||
{
|
||||
Msg(errno,"Could not write %s", UtmpName);
|
||||
UT_CLOSE;
|
||||
@@ -607,7 +564,7 @@ struct utmp *u;
|
||||
struct utmp *u;
|
||||
{
|
||||
u->ut_type = DEAD_PROCESS;
|
||||
-#if (!defined(linux) || defined(EMPTY)) && !defined(__CYGWIN__)
|
||||
+#if (!defined(linux) || defined(EMPTY)) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
|
||||
u->ut_exit.e_termination = 0;
|
||||
u->ut_exit.e_exit = 0;
|
||||
#endif
|
||||
@@ -640,7 +597,11 @@ int pid;
|
||||
/* must use temp variable because of NetBSD/sparc64, where
|
||||
* ut_xtime is long(64) but time_t is int(32) */
|
||||
(void)time(&now);
|
||||
- u->ut_time = now;
|
||||
+#if defined(__FreeBSD_version) && __FreeBSD_version < 900000
|
||||
+ u->ut_time = now;
|
||||
+#else
|
||||
+ u->ut_tv.tv_sec = now;
|
||||
+#endif
|
||||
}
|
||||
|
||||
static slot_t
|
||||
@@ -670,6 +631,7 @@ initutmp()
|
||||
return (utmpfd = open(UtmpName, O_RDWR)) >= 0;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
static void
|
||||
setutent()
|
||||
{
|
||||
@@ -694,6 +656,7 @@ getutent()
|
||||
return 0;
|
||||
return &uent;
|
||||
}
|
||||
+#endif
|
||||
|
||||
static struct utmp *
|
||||
getutslot(slot)
|
||||
@@ -750,9 +713,13 @@ int pid;
|
||||
{
|
||||
time_t now;
|
||||
strncpy(u->ut_line, line, sizeof(u->ut_line));
|
||||
- strncpy(u->ut_name, user, sizeof(u->ut_name));
|
||||
+ strncpy(u->ut_user, user, sizeof(u->ut_user));
|
||||
(void)time(&now);
|
||||
- u->ut_time = now;
|
||||
+#if defined(__FreeBSD_version) && __FreeBSD_version < 900000
|
||||
+ u->ut_time = now;
|
||||
+#else
|
||||
+ u->ut_tv.tv_sec = now;
|
||||
+#endif
|
||||
}
|
||||
|
||||
static slot_t
|
||||
@ -1,10 +0,0 @@
|
||||
startup_message off
|
||||
defscrollback 5000
|
||||
termcapinfo xterm ti@:te@
|
||||
termcapinfo xterm-color ti@:te@
|
||||
hardstatus alwayslastline
|
||||
hardstatus string '%{gk}[%{G}%H%{g}][%= %{wk}%?%-Lw%?%{=b kR}(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= kw}%?%+Lw%?%?%= %{g}]%{=b C}[%m/%d/%y %C %A]%{W}'
|
||||
vbell off
|
||||
shell -$SHELL
|
||||
logtstamp on
|
||||
logtstamp after 1
|
||||
@ -1,7 +0,0 @@
|
||||
Screen is a full-screen window manager that multiplexes a physical terminal
|
||||
between several processes (typically interactive shells).
|
||||
Each virtual terminal provides the functions of a DEC VT100 terminal and, in
|
||||
addition, several control functions from the ANSI X3.64 (ISO 6429) and ISO
|
||||
2022 standards (e.g. insert/delete line and support for multiple character
|
||||
sets). There is a scrollback history buffer for each virtual terminal and a
|
||||
copy-and-paste mechanism that allows moving text regions between windows.
|
||||
@ -1,11 +0,0 @@
|
||||
[
|
||||
{ type: install
|
||||
message: <<EOM
|
||||
As of GNU Screen 4.4.0:
|
||||
|
||||
Note that there was fix to screen message structure field
|
||||
responsible for $TERM handling, making it impossible
|
||||
to attach to older versions.
|
||||
EOM
|
||||
}
|
||||
]
|
||||
@ -1,26 +0,0 @@
|
||||
bin/screen
|
||||
%%MULTISUID%%bin/screen-4.9.1
|
||||
share/man/man1/screen.1.gz
|
||||
%%DATADIR%%/utf8encodings/01
|
||||
%%DATADIR%%/utf8encodings/02
|
||||
%%DATADIR%%/utf8encodings/03
|
||||
%%DATADIR%%/utf8encodings/04
|
||||
%%DATADIR%%/utf8encodings/18
|
||||
%%DATADIR%%/utf8encodings/19
|
||||
%%DATADIR%%/utf8encodings/a1
|
||||
%%DATADIR%%/utf8encodings/bf
|
||||
%%DATADIR%%/utf8encodings/c2
|
||||
%%DATADIR%%/utf8encodings/c3
|
||||
%%DATADIR%%/utf8encodings/c4
|
||||
%%DATADIR%%/utf8encodings/c6
|
||||
%%DATADIR%%/utf8encodings/c7
|
||||
%%DATADIR%%/utf8encodings/c8
|
||||
%%DATADIR%%/utf8encodings/cc
|
||||
%%DATADIR%%/utf8encodings/cd
|
||||
%%DATADIR%%/utf8encodings/d6
|
||||
@comment We always install the same screenrc it just depends on if we
|
||||
@comment are installing the the one bundled with source, or the one from
|
||||
@comment FILESDIR/screenrc.sample
|
||||
@sample %%ETCDIR%%/screenrc.sample
|
||||
%%EXAMPLESDIR%%/screenrc.sample-1
|
||||
%%EXAMPLESDIR%%/screenrc.sample-2
|
||||
Loading…
x
Reference in New Issue
Block a user