On Thu, Sep 05 2019, Stuart Henderson <[email protected]> wrote:
> Most of us have long moved on to tmux but I think it would still make
> sense to keep screen up to date so here's a diff for 4.6.2. Many of the
> patches are no longer needed, but there are a few new ones (drawing
> attention in particular to patch-tty_sh, without which "inappropriate
> ioctl" messages are seen, and patch-osdef_h_in which I noticed in
> FreeBSD's patches and AFAIK also applies to us).
>
> Any comments/test reports, especially from anyone with a more complex
> config?
Works fine with an old config of mine.
--8<--
startup_message off
defutf8 on
defnonblock 5
autodetach on
nonblock on
defscrollback 4096
bind ^k
bind ^\
bind \\ quit
bind i focus top
bind k focus bottom
bind j focus up
bind l focus down
bind K kill
bind I login on
bind O login off
bind } history
hardstatus alwayslastline "%{= kb} %-w%{kw}%n %t%{-}%+w %=%{..m}%1` %{= kr}%2`
%{kw}%D %d %3` %0c %{= dd}"
caption splitonly "%?%F%{= .bw}%:%{= .kw}%? %=%{..C}%n%{-} %t%= "
-->8--
[...]
> Index: patches/patch-doc_screen_1
> ===================================================================
> RCS file: /cvs/ports/misc/screen/patches/patch-doc_screen_1,v
> retrieving revision 1.5
> diff -u -p -r1.5 patch-doc_screen_1
> --- patches/patch-doc_screen_1 15 Aug 2019 21:01:49 -0000 1.5
> +++ patches/patch-doc_screen_1 5 Sep 2019 13:00:46 -0000
> @@ -1,17 +1,18 @@
> -$OpenBSD: patch-doc_screen_1,v 1.5 2019/08/15 21:01:49 naddy Exp $
> +$OpenBSD$
> +
> Index: doc/screen.1
> --- doc/screen.1.orig
> +++ doc/screen.1
> -@@ -99,7 +99,7 @@ create the new window.
> - The above example would start the emacs editor (editing prog.c) and switch
> - to its window.
> +@@ -103,7 +103,7 @@ to its window. - Note that you cannot transport enviro
> + the invoking shell to the application (emacs in this case), because it is
> + forked from the parent screen process, not from the invoking shell.
> .PP
> -If \*Q/etc/utmp\*U is writable by
> +If \*Q/var/run/utmp\*U is writable by
> .IR screen ,
> an appropriate record will be written to this file for each window, and
> removed when the window is terminated.
> -@@ -228,7 +228,7 @@ See the \*Qdefflow\*U .screenrc command for details.
> +@@ -232,7 +232,7 @@ See the \*Qdefflow\*U .screenrc command for details.
> The use of this option is discouraged.
> .TP 5
> .BR \-l " and " \-ln
> @@ -19,41 +20,32 @@ Index: doc/screen.1
> +turns login mode on or off (for /var/run/utmp updating).
> This can also be defined through the \*Qdeflogin\*U .screenrc command.
> .TP 5
> - .BR \-ls " and " \-list
> -@@ -594,7 +594,7 @@ in the environment variable $SCREENDIR.
> + .BR \-ls " [" \fImatch ]
> +@@ -725,7 +725,7 @@ in the environment variable $SCREENDIR.
> When
> .I screen
> is invoked, it executes initialization commands from the files
> -\*Q/usr/local/etc/screenrc\*U and
> -+\*Q!!sysconfdir!!/screenrc\*U and
> ++\*Q${SYSCONFDIR}/screenrc\*U and
> \*Q.screenrc\*U in the user's home directory. These are the \*Qprogrammer's
> defaults\*U that can be overridden in the following ways: for the
> global screenrc file
> -@@ -1669,7 +1669,7 @@ and then compile the entry with
> - The echo command may be used to annoy
> - .I screen
> - users with a 'message of the
> --day'. Typically installed in a global /local/etc/screenrc.
> -+day'. Typically installed in a global !!sysconfdir!!/screenrc.
Looks like this hunk was dropped when you converted the patch to
SUBST_CMD. Here's an updated diff.
ok jca@
Index: Makefile
===================================================================
RCS file: /cvs/ports/misc/screen/Makefile,v
retrieving revision 1.71
diff -u -p -r1.71 Makefile
--- Makefile 5 Sep 2019 11:50:48 -0000 1.71
+++ Makefile 5 Sep 2019 14:13:55 -0000
@@ -2,23 +2,20 @@
COMMENT= multi-screen window manager
-VERSION= 4.0.3
-DISTNAME= screen-${VERSION}
-REVISION= 8
+DISTNAME= screen-4.6.2
CATEGORIES= misc
MASTER_SITES= ${MASTER_SITE_GNU:=screen/}
HOMEPAGE= https://www.gnu.org/software/screen/
-# GPLv2+
+# GPLv3+
PERMIT_PACKAGE= Yes
-SUBST_VARS= VERSION
-
-AUTOCONF_VERSION=2.57
+AUTOCONF_VERSION=2.69
CONFIGURE_STYLE= autoconf no-autoheader
CONFIGURE_ARGS= --with-sys-screenrc="${SYSCONFDIR}/screenrc"
-USE_GROFF = Yes
+USE_GMAKE= Yes
+USE_GROFF= Yes
FLAVORS= static
FLAVOR?=
@@ -30,12 +27,13 @@ WANTLIB= c curses util
.endif
ALL_TARGET= screen screen.info
+#MAKE_FLAGS= OPTIONS=-DDEBUG
pre-build:
- @perl -pi -e s#!!sysconfdir!!#${SYSCONFDIR}#g ${WRKSRC}/doc/screen.1
+ @${SUBST_CMD} ${WRKSRC}/doc/screen.1
post-install:
- @cd ${PREFIX}/bin && mv -f screen-${VERSION} screen
+ @cd ${PREFIX}/bin && mv -f screen-* screen
@chmod 755 ${PREFIX}/bin/screen
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/screen
${INSTALL_DATA} ${WRKSRC}/etc/etcscreenrc \
Index: distinfo
===================================================================
RCS file: /cvs/ports/misc/screen/distinfo,v
retrieving revision 1.11
diff -u -p -r1.11 distinfo
--- distinfo 18 Jan 2015 03:14:33 -0000 1.11
+++ distinfo 5 Sep 2019 14:13:55 -0000
@@ -1,2 +1,2 @@
-SHA256 (screen-4.0.3.tar.gz) = ePDVsUlghKWQJYYwTUpzlUsr/jPqE+3O7PIWFcOebHc=
-SIZE (screen-4.0.3.tar.gz) = 840602
+SHA256 (screen-4.6.2.tar.gz) = G2kiUg5qDOXih2jWILD2QKZjE5f5XMsEO3C5G7UD+jo=
+SIZE (screen-4.6.2.tar.gz) = 845210
Index: patches/patch-ansi_c
===================================================================
RCS file: patches/patch-ansi_c
diff -N patches/patch-ansi_c
--- patches/patch-ansi_c 11 Sep 2015 14:04:59 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,43 +0,0 @@
-$OpenBSD: patch-ansi_c,v 1.4 2015/09/11 14:04:59 jasper Exp $
-
-Security fix for CVE-2015-6806,
-screen: Stack overflow due to deep recursion causing process freeze
-
---- ansi.c.orig Fri Dec 5 14:57:05 2003
-+++ ansi.c Tue Sep 1 14:03:33 2015
-@@ -2425,13 +2425,13 @@ int n, ys, ye, bce;
- return;
- if (n > 0)
- {
-+ if (ye - ys + 1 < n)
-+ n = ye - ys + 1;
- if (n > 256)
- {
- MScrollV(p, n - 256, ys, ye, bce);
- n = 256;
- }
-- if (ye - ys + 1 < n)
-- n = ye - ys + 1;
- #ifdef COPY_PASTE
- if (compacthist)
- {
-@@ -2482,14 +2482,14 @@ int n, ys, ye, bce;
- }
- else
- {
-- if (n < -256)
-- {
-- MScrollV(p, n + 256, ys, ye, bce);
-- n = -256;
-- }
- n = -n;
- if (ye - ys + 1 < n)
- n = ye - ys + 1;
-+ if (n > 256)
-+ {
-+ MScrollV(p, - (n - 256), ys, ye, bce);
-+ n = 256;
-+ }
-
- ml = p->w_mlines + ye;
- /* Clear lines */
Index: patches/patch-configure_ac
===================================================================
RCS file: patches/patch-configure_ac
diff -N patches/patch-configure_ac
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-configure_ac 5 Sep 2019 14:13:55 -0000
@@ -0,0 +1,49 @@
+$OpenBSD$
+
+Index: configure.ac
+--- configure.ac.orig
++++ configure.ac
+@@ -374,7 +374,7 @@ main()
+ }
+ ], AC_NOTE(- your fifos are usable) fifo=1,
+ AC_NOTE(- your fifos are not usable))
+-rm -f /tmp/conftest*
++rm -f /tmp/conftest$$
+
+ if test -n "$fifo"; then
+ AC_CHECKING(for broken fifo implementation)
+@@ -422,7 +422,7 @@ main()
+ }
+ ], AC_NOTE(- your implementation is ok),
+ AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1)
+-rm -f /tmp/conftest*
++rm -f /tmp/conftest$$
+ fi
+
+ dnl
+@@ -484,7 +484,7 @@ main()
+ }
+ ], AC_NOTE(- your sockets are usable) sock=1,
+ AC_NOTE(- your sockets are not usable))
+-rm -f /tmp/conftest*
++rm -f /tmp/conftest$$
+
+ if test -n "$sock"; then
+ AC_CHECKING(socket implementation)
+@@ -523,7 +523,7 @@ main()
+ ],AC_NOTE(- you are normal),
+ AC_NOTE(- unix domain sockets are not kept in the filesystem)
+ AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1)
+-rm -f /tmp/conftest*
++rm -f /tmp/conftest$$
+ fi
+
+
+@@ -624,6 +624,7 @@ main()
+ }
+ ],AC_NOTE(- select is ok),
+ AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN))
++rm -f /tmp/conftest$$
+
+ dnl
+ dnl **** termcap or terminfo ****
Index: patches/patch-configure_in
===================================================================
RCS file: patches/patch-configure_in
diff -N patches/patch-configure_in
--- patches/patch-configure_in 15 Aug 2019 21:01:49 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,62 +0,0 @@
-$OpenBSD: patch-configure_in,v 1.1 2019/08/15 21:01:49 naddy Exp $
-
-Index: configure.in
---- configure.in.orig
-+++ configure.in
-@@ -359,7 +359,7 @@ main()
- }
- ], AC_NOTE(- your fifos are usable) fifo=1,
- AC_NOTE(- your fifos are not usable))
--rm -f /tmp/conftest*
-+rm -f /tmp/conftest$$
-
- if test -n "$fifo"; then
- AC_CHECKING(for broken fifo implementation)
-@@ -409,7 +409,7 @@ main()
- }
- ], AC_NOTE(- your implementation is ok),
- AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1)
--rm -f /tmp/conftest*
-+rm -f /tmp/conftest$$
- fi
-
- dnl
-@@ -471,7 +471,7 @@ main()
- }
- ], AC_NOTE(- your sockets are usable) sock=1,
- AC_NOTE(- your sockets are not usable))
--rm -f /tmp/conftest*
-+rm -f /tmp/conftest$$
-
- if test -n "$sock"; then
- AC_CHECKING(socket implementation)
-@@ -503,7 +503,7 @@ main()
- ],AC_NOTE(- you are normal),
- AC_NOTE(- unix domain sockets are not kept in the filesystem)
- AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1)
--rm -f /tmp/conftest*
-+rm -f /tmp/conftest$$
- fi
-
-
-@@ -636,6 +636,7 @@ main()
- }
- ],AC_NOTE(- select is ok),
- AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN))
-+rm -f /tmp/conftest$$
-
- dnl
- dnl **** termcap or terminfo ****
-@@ -1203,10 +1204,10 @@ else
- AC_MSG_RESULT(no)
- AC_DEFINE(NAME_MAX, 14)
- fi
--rm -f /tmp/conftest*
-+rm -f /tmp/conftest9012345 /tmp/conftest9012346
-
- AC_MSG_CHECKING(for vsprintf)
--AC_TRY_LINK(,[vsprintf(0,0,0);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS),
AC_MSG_RESULT(no))
-+AC_TRY_LINK([#include <stdarg.h>],[va_list ap; vsprintf(0,0,ap);],
AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
-
- AC_HEADER_DIRENT
-
Index: patches/patch-doc_screen_1
===================================================================
RCS file: /cvs/ports/misc/screen/patches/patch-doc_screen_1,v
retrieving revision 1.5
diff -u -p -r1.5 patch-doc_screen_1
--- patches/patch-doc_screen_1 15 Aug 2019 21:01:49 -0000 1.5
+++ patches/patch-doc_screen_1 5 Sep 2019 14:13:55 -0000
@@ -1,17 +1,18 @@
-$OpenBSD: patch-doc_screen_1,v 1.5 2019/08/15 21:01:49 naddy Exp $
+$OpenBSD$
+
Index: doc/screen.1
--- doc/screen.1.orig
+++ doc/screen.1
-@@ -99,7 +99,7 @@ create the new window.
- The above example would start the emacs editor (editing prog.c) and switch
- to its window.
+@@ -103,7 +103,7 @@ to its window. - Note that you cannot transport enviro
+ the invoking shell to the application (emacs in this case), because it is
+ forked from the parent screen process, not from the invoking shell.
.PP
-If \*Q/etc/utmp\*U is writable by
+If \*Q/var/run/utmp\*U is writable by
.IR screen ,
an appropriate record will be written to this file for each window, and
removed when the window is terminated.
-@@ -228,7 +228,7 @@ See the \*Qdefflow\*U .screenrc command for details.
+@@ -232,7 +232,7 @@ See the \*Qdefflow\*U .screenrc command for details.
The use of this option is discouraged.
.TP 5
.BR \-l " and " \-ln
@@ -19,41 +20,41 @@ Index: doc/screen.1
+turns login mode on or off (for /var/run/utmp updating).
This can also be defined through the \*Qdeflogin\*U .screenrc command.
.TP 5
- .BR \-ls " and " \-list
-@@ -594,7 +594,7 @@ in the environment variable $SCREENDIR.
+ .BR \-ls " [" \fImatch ]
+@@ -725,7 +725,7 @@ in the environment variable $SCREENDIR.
When
.I screen
is invoked, it executes initialization commands from the files
-\*Q/usr/local/etc/screenrc\*U and
-+\*Q!!sysconfdir!!/screenrc\*U and
++\*Q${SYSCONFDIR}/screenrc\*U and
\*Q.screenrc\*U in the user's home directory. These are the \*Qprogrammer's
defaults\*U that can be overridden in the following ways: for the
global screenrc file
-@@ -1669,7 +1669,7 @@ and then compile the entry with
+@@ -1953,7 +1953,7 @@ when seeing proper escape sequence. See also "TITLES (
The echo command may be used to annoy
.I screen
users with a 'message of the
-day'. Typically installed in a global /local/etc/screenrc.
-+day'. Typically installed in a global !!sysconfdir!!/screenrc.
- The option \*Q-n\*U may be used to suppress the line feed.
++day'. Typically installed in a global ${SYSCONFDIR}/screenrc.
+ The option \*Q\-n\*U may be used to suppress the line feed.
See also \*Qsleep\*U.
Echo is also useful for online checking of environment variables.
-@@ -4416,12 +4416,12 @@ Examples in the
+@@ -5087,12 +5087,12 @@ Examples in the
.I screen
distribution package for private and global initialization files.
.IP $SYSSCREENRC
-.IP /usr/local/etc/screenrc
-+.IP !!sysconfdir!!/screenrc
++.IP ${SYSCONFDIR}/screenrc
.I screen
initialization commands
.IP $SCREENRC
.IP $HOME/.screenrc
-Read in after /usr/local/etc/screenrc
-+Read in after !!sysconfdir!!/screenrc
- .IP $SCREENDIR/S-<login>
- .IP /local/screens/S-<login>
++Read in after ${SYSCONFDIR}/screenrc
+ .IP $SCREENDIR/S\-<login>
+ .IP /local/screens/S\-<login>
Socket directories (default)
-@@ -4442,7 +4442,7 @@ Output log files created by the log function
+@@ -5113,7 +5113,7 @@ Output log files created by the log function
or
.IP /etc/termcap
Terminal capability databases
@@ -62,7 +63,7 @@ Index: doc/screen.1
Login records
.IP $LOCKPRG
Program that locks a terminal.
-@@ -4555,9 +4555,9 @@ does not make use of hardware tabs.
+@@ -5235,9 +5235,9 @@ does not make use of hardware tabs.
must be installed as set-uid with owner root on most systems in order
to be able to correctly change the owner of the tty device file for
each window.
Index: patches/patch-extern_h
===================================================================
RCS file: patches/patch-extern_h
diff -N patches/patch-extern_h
--- patches/patch-extern_h 23 Mar 2012 21:37:50 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-$OpenBSD: patch-extern_h,v 1.1 2012/03/23 21:37:50 naddy Exp $
---- extern.h.orig Fri Mar 23 22:26:34 2012
-+++ extern.h Fri Mar 23 22:27:04 2012
-@@ -146,7 +146,9 @@ extern void CloseDevice __P((struct win *));
- #ifdef ZMODEM
- extern void zmodem_abort __P((struct win *, struct display *));
- #endif
-+#if 0
- extern void execvpe __P((char *, char **, char **));
-+#endif
-
- /* utmp.c */
- #ifdef UTMPOK
Index: patches/patch-fileio_c
===================================================================
RCS file: patches/patch-fileio_c
diff -N patches/patch-fileio_c
--- patches/patch-fileio_c 23 Mar 2012 21:37:50 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-fileio_c,v 1.2 2012/03/23 21:37:50 naddy Exp $
---- fileio.c.orig Mon Sep 8 16:25:28 2003
-+++ fileio.c Fri Mar 23 22:27:59 2012
-@@ -779,7 +779,7 @@ char *cmd;
- #ifdef SIGPIPE
- signal(SIGPIPE, SIG_DFL);
- #endif
-- execl("/bin/sh", "sh", "-c", cmd, 0);
-+ execl("/bin/sh", "sh", "-c", cmd, NULL);
- Panic(errno, "/bin/sh");
- default:
- break;
Index: patches/patch-os_h
===================================================================
RCS file: patches/patch-os_h
diff -N patches/patch-os_h
--- patches/patch-os_h 15 Aug 2019 21:01:49 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: patch-os_h,v 1.1 2019/08/15 21:01:49 naddy Exp $
-
-Index: os.h
---- os.h.orig
-+++ os.h
-@@ -70,6 +70,9 @@ extern int errno;
- #undef strerror
- #endif
-
-+#ifdef POSIX
-+# include <string.h>
-+#endif
- #if !defined(SYSV) && !defined(linux)
- # ifdef NEWSOS
- # define strlen ___strlen___
Index: patches/patch-osdef_h_in
===================================================================
RCS file: patches/patch-osdef_h_in
diff -N patches/patch-osdef_h_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-osdef_h_in 5 Sep 2019 14:13:55 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: osdef.h.in
+--- osdef.h.in.orig
++++ osdef.h.in
+@@ -111,7 +111,7 @@ extern int setsid __P((void));
+ extern int setpgid __P((int, int));
+ extern int tcsetpgrp __P((int, int));
+ #endif
+-extern int ioctl __P((int, int, char *));
++extern int ioctl __P((int, unsigned long, char *));
+
+ extern int kill __P((int, int));
+
Index: patches/patch-pty_c
===================================================================
RCS file: /cvs/ports/misc/screen/patches/patch-pty_c,v
retrieving revision 1.3
diff -u -p -r1.3 patch-pty_c
--- patches/patch-pty_c 5 Jan 2004 02:00:54 -0000 1.3
+++ patches/patch-pty_c 5 Sep 2019 14:13:55 -0000
@@ -1,7 +1,11 @@
-$OpenBSD: patch-pty_c,v 1.3 2004/01/05 02:00:54 brad Exp $
---- pty.c.orig 2003-09-08 10:26:18.000000000 -0400
-+++ pty.c 2004-01-04 21:00:15.000000000 -0500
-@@ -25,6 +25,7 @@
+$OpenBSD$
+
+for openpty()
+
+Index: pty.c
+--- pty.c.orig
++++ pty.c
+@@ -30,6 +30,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
Index: patches/patch-tty_sh
===================================================================
RCS file: patches/patch-tty_sh
diff -N patches/patch-tty_sh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-tty_sh 5 Sep 2019 14:13:55 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: tty.sh
+--- tty.sh.orig
++++ tty.sh
+@@ -813,7 +813,7 @@ int fd;
+ /*
+ * Under BSD we have to set the controlling terminal again explicitly.
+ */
+-# if (defined(__FreeBSD_kernel__) || defined(__DragonFly__) ||
defined(__GNU__)) && defined(TIOCSCTTY)
++# if (defined(__FreeBSD_kernel__) || defined(__DragonFly__) ||
defined(__GNU__) || defined(__OpenBSD__)) && defined(TIOCSCTTY)
+ ioctl(fd, TIOCSCTTY, (char *)0);
+ # endif
+
Index: patches/patch-window_c
===================================================================
RCS file: patches/patch-window_c
diff -N patches/patch-window_c
--- patches/patch-window_c 23 Mar 2012 21:37:50 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-$OpenBSD: patch-window_c,v 1.1 2012/03/23 21:37:50 naddy Exp $
---- window.c.orig Fri Mar 23 22:25:23 2012
-+++ window.c Fri Mar 23 22:26:20 2012
-@@ -1387,6 +1387,7 @@ char **args, *ttyn;
- return pid;
- }
-
-+#if 0
- void
- execvpe(prog, args, env)
- char *prog, **args, **env;
-@@ -1432,6 +1433,7 @@ char *prog, **args, **env;
- if (eaccess)
- errno = EACCES;
- }
-+#endif
-
- #ifdef PSEUDOS
-
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE