<pre style='margin:0'>
Zero King (l2dy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/4e83768a2da5ff16752c4dd07b4a729e63f78908">https://github.com/macports/macports-ports/commit/4e83768a2da5ff16752c4dd07b4a729e63f78908</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 4e83768 screen: limit termcap, fix blanker, fix error messages
</span>4e83768 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 4e83768a2da5ff16752c4dd07b4a729e63f78908
</span>Author: Scott Shambarger <devel@shambarger.net>
AuthorDate: Fri Jan 18 16:05:30 2019 -0500
<span style='display:block; white-space:pre;color:#404040;'> screen: limit termcap, fix blanker, fix error messages
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Screen creates invalid TERMCAP entries for full featured terminals
</span><span style='display:block; white-space:pre;color:#404040;'> like xterm-256color. Adds patch to limit the size of TERMCAP
</span><span style='display:block; white-space:pre;color:#404040;'> to 1023 characters by skipping some function keys but keeping
</span><span style='display:block; white-space:pre;color:#404040;'> important navigation keys.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Screen currently fails to run blanker when suid root. Adds patch
</span><span style='display:block; white-space:pre;color:#404040;'> to correctly prepare the PTY before running the blanker. Also
</span><span style='display:block; white-space:pre;color:#404040;'> allows errors to be displayed when blanker is blocking the display.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> When screen fails in a child process and is suid root, the Panic
</span><span style='display:block; white-space:pre;color:#404040;'> message isn't sent as the Panic process also Panics. Adds patch
</span><span style='display:block; white-space:pre;color:#404040;'> to correctly set the internal effective uid so that error messages
</span><span style='display:block; white-space:pre;color:#404040;'> are sent to the parent. Also fixes children to not remove the
</span><span style='display:block; white-space:pre;color:#404040;'> screen socket when they Panic.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> I've submitted all patches upstream, but it appears the maintainers
</span><span style='display:block; white-space:pre;color:#404040;'> don't often push new screen releases.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/48661
</span>---
sysutils/screen/Portfile | 7 +-
sysutils/screen/files/patch-blanker-fix.diff | 168 +++++++++++++++++++++
.../screen/files/patch-limit-termcap-size.diff | 154 +++++++++++++++++++
sysutils/screen/files/patch-panic-fix.diff | 140 +++++++++++++++++
4 files changed, 467 insertions(+), 2 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/sysutils/screen/Portfile b/sysutils/screen/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 65c45ca..1eb4e8a 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/sysutils/screen/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/sysutils/screen/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4,7 +4,7 @@ PortSystem 1.0
</span>
name screen
version 4.6.2
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 2
</span> homepage https://www.gnu.org/software/screen/
description Screen manager with VT100/ANSI terminal emulation
long_description \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -41,7 +41,10 @@ checksums ${distname}${extract.suffix} \
</span> sha256 dcd2786d82865fb10542c20e97d7052110f7ca9a551f2ab5628c607f20e2bb2f
patchfiles patch-apple.diff \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- patch-config.h.in.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-config.h.in.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-limit-termcap-size.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-blanker-fix.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-panic-fix.diff
</span> depends_lib port:ncurses
extract.only ${distname}${extract.suffix}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/sysutils/screen/files/patch-blanker-fix.diff b/sysutils/screen/files/patch-blanker-fix.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..2e43c6c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/sysutils/screen/files/patch-blanker-fix.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,168 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Fix blanker to work when screen is suid root
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* Change RunBlanker to call OpenDevice so permissions on slave
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PTY are correctly set.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* Update handling of file descriptors after fork to be similar to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ForkWindow on at pty (fixes debug and leaked descriptors)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* DEBUG now creates screen.blanker to debug blanker fork
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* Allow display of error message when display blocked by blanker
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (because message is probably from blanker failing to start)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Fixes screen bug: https://savannah.gnu.org/bugs/?55512
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Signed-off-by: Scott Shambarger <devel@shambarger.net>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- display.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ display.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -3958,6 +3958,7 @@ char **cmdv;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char *m;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int pid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int slave = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int ptype = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char termname[MAXTERMLEN + 6];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifndef TIOCSWINSZ
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char libuf[20], cobuf[20];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -3969,9 +3970,9 @@ char **cmdv;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ termname[sizeof(termname) - 1] = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ KillBlanker();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ D_blankerpid = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((D_blankerev.fd = OpenPTY(&m)) == -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((D_blankerev.fd = OpenDevice(cmdv, 0, &ptype, &m)) == -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Msg(0, "OpenPty failed");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Msg(0, "OpenDevice failed");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef O_NOCTTY
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -3996,25 +3997,48 @@ char **cmdv;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case 0:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ displays = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef DEBUG
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (dfp && dfp != stderr)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- fclose(dfp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- dfp = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef SIGPIPE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ signal(SIGPIPE, SIG_DFL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (setgid(real_gid) || setuid(real_uid))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Panic(errno, "setuid/setgid");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ brktty(D_userfd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ freetty();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef DEBUG
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (dfp && dfp != stderr)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fclose(dfp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (slave != -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ close(0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ dup(slave);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ close(slave);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ closeallfiles(D_blankerev.fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ slave = dup(0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ closeallfiles(D_blankerev.fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#ifdef DEBUG
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (dfp)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ char buf[256];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sprintf(buf, "%s/screen.blanker", DEBUGDIR);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((dfp = fopen(buf, "a")) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ dfp = stderr;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void) chmod(buf, 0666);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ debug1("=== RunBlanker: pid %d\n", (int)getpid());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ close(0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ close(1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ close(2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- closeallfiles(slave);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (open(m, O_RDWR))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Panic(errno, "Cannot open %s", m);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dup(0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dup(0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ close(D_blankerev.fd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (slave != -1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ close(slave);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ InitPTY(0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -4028,17 +4052,17 @@ char **cmdv;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ glwz.ws_row = D_height;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (void)ioctl(0, TIOCSWINSZ, (char *)&glwz);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* Always turn off nonblocking mode */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (void)fcntl(0, F_SETFL, 0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sprintf(libuf, "LINES=%d", D_height);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sprintf(cobuf, "COLUMNS=%d", D_width);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *np++ = libuf;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *np++ = cobuf;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef SIGPIPE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- signal(SIGPIPE, SIG_DFL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- display = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ debug1("calling execvpe %s\n", *cmdv);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ execvpe(*cmdv, cmdv, NewEnv + 3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Panic(errno, "%s", *cmdv);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ debug1("exec error: %d\n", errno);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Panic(errno, "Cannot exec '%s'", *cmdv);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ default:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- socket.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ socket.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -742,6 +742,7 @@ char *tty, *buf;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ struct msg m;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bool is_socket;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ debug2("SendErrorMsg: %s %s\n", tty, buf);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ strncpy(m.m.message, buf, sizeof(m.m.message) - 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ m.m.message[sizeof(m.m.message) - 1] = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ is_socket = IsSocket(SockPath);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1237,7 +1238,13 @@ ReceiveMsg()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ FinishAttach(&m);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case MSG_ERROR:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int blocked=D_blocked;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(D_blocked == 4) /* allow error messages while in blanker mode */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ D_blocked=0; /* likely they're from failed blanker */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Msg(0, "%s", m.m.message);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ D_blocked=blocked;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case MSG_HANGUP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!wi) /* ignore hangups from inside */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- window.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ window.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -102,7 +102,6 @@ static void pseu_writeev_fn __P((struct event *, char *));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void win_silenceev_fn __P((struct event *, char *));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void win_destroyev_fn __P((struct event *, char *));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static int OpenDevice __P((char **, int, int *, char **));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int ForkWindow __P((struct win *, char **, char *));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef ZMODEM
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void zmodem_found __P((struct win *, int, char *, int));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1091,7 +1090,7 @@ struct win *wp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ free((char *)wp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ OpenDevice(args, lflag, typep, namep)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char **args;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int lflag;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- window.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ window.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -351,6 +351,7 @@ struct win
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define Layer2Window(l) ((struct win *)(l)->l_bottom->l_data)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int WindowChangeNumber __P((int, int));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int OpenDevice __P((char **, int, int *, char **));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif /* SCREEN_WINDOW_H */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/sysutils/screen/files/patch-limit-termcap-size.diff b/sysutils/screen/files/patch-limit-termcap-size.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..57f6611
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/sysutils/screen/files/patch-limit-termcap-size.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,154 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Create TERMCAP entries limited to 1023 bytes by default.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+TERMCAP_BUF defaults to 1023 to create TERMCAP entries that work on
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+most systems. To save space, TERMCAP is unwrapped, and vt220 extra
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+keys are skipped (unless TERMCAP_BUF > 1023); navigation keys are
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+still included. Entries larger than TERMCAP_BUF are now truncated,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+and no longer Panic screen.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Termcap entries are still wrapped when saved to a file.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Fixes screen bug: https://savannah.gnu.org/bugs/?55482
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Signed-off-by: Scott Shambarger <devel@shambarger.net>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- extern.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ extern.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -235,6 +235,7 @@ extern int StuffKey __P((int));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* termcap.c */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern int InitTermcap __P((int, int));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern char *MakeTermcap __P((int));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extern void DumpTermcap __P((int, FILE *));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern char *gettermcapstring __P((char *));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef MAPKEYS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern int remap __P((int, int));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- fileio.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ fileio.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -479,10 +479,7 @@ void WriteFile(struct acluser *user, char *fn, int dump) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case DUMP_TERMCAP:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((p = index(MakeTermcap(fore->w_aflag), '=')) != NULL) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- fputs(++p, f);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- putc('\n', f);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ DumpTermcap(fore->w_aflag, f);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef COPY_PASTE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- os.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ os.h
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -507,7 +507,7 @@ typedef struct fd_set { int fds_bits[1]; } fd_set;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifndef TERMCAP_BUFSIZE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# define TERMCAP_BUFSIZE 2048
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# define TERMCAP_BUFSIZE 1023
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifndef MAXPATHLEN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- term.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ term.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -197,6 +197,7 @@ struct term term[T_N] =
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { "F1", T_STR }, KMAPDEF("\033[23~")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { "F2", T_STR }, KMAPDEF("\033[24~")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* extra keys for vt220 (David.Leonard@it.uq.edu.au) */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++/* define T_FEXTRA */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { "F3", T_STR },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { "F4", T_STR },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { "F5", T_STR },
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- termcap.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ termcap.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -75,11 +75,10 @@ char screenterm[MAXTERMLEN + 1]; /* new $TERM, usually "screen" */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char *extra_incap, *extra_outcap;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-static const char TermcapConst[] = "\\\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-\t:DO=\\E[%dB:LE=\\E[%dD:RI=\\E[%dC:UP=\\E[%dA:bs:bt=\\E[Z:\\\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-\t:cd=\\E[J:ce=\\E[K:cl=\\E[H\\E[J:cm=\\E[%i%d;%dH:ct=\\E[3g:\\\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-\t:do=^J:nd=\\E[C:pt:rc=\\E8:rs=\\Ec:sc=\\E7:st=\\EH:up=\\EM:\\\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-\t:le=^H:bl=^G:cr=^M:it#8:ho=\\E[H:nw=\\EE:ta=^I:is=\\E)0:";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static const char TermcapConst[] = "DO=\\E[%dB:LE=\\E[%dD:RI=\\E[%dC:\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++UP=\\E[%dA:bs:bt=\\E[Z:cd=\\E[J:ce=\\E[K:cl=\\E[H\\E[J:cm=\\E[%i%d;%dH:\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ct=\\E[3g:do=^J:nd=\\E[C:pt:rc=\\E8:rs=\\Ec:sc=\\E7:st=\\EH:up=\\EM:\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++le=^H:bl=^G:cr=^M:it#8:ho=\\E[H:nw=\\EE:ta=^I:is=\\E)0:";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ gettermcapstring(s)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -824,21 +823,13 @@ AddCap(s)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char *s;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ register int n;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (tcLineLen + (n = strlen(s)) > 55 && Termcaplen < TERMCAP_BUFSIZE - 4 - 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- strcpy(Termcap + Termcaplen, "\\\n\t:");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Termcaplen += 4;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tcLineLen = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ n=strlen(s);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (Termcaplen + n < TERMCAP_BUFSIZE - 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ strcpy(Termcap + Termcaplen, s);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Termcaplen += n;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tcLineLen += n;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Panic(0, "TERMCAP overflow - sorry.");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1074,6 +1065,12 @@ int aflag;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (i >= T_KEYPAD) /* don't put keypad codes in TERMCAP */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue; /* - makes it too big */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if (TERMCAP_BUF < 1024)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (i >= T_FEXTRA && i < T_BACKTAB) /* also skip extra vt220 keys */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (i > T_BACKTAB && i < T_NAVIGATE) /* more vt220 keys */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ continue;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (i >= T_CURSOR && i < T_OCAPS)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ act = &umtab[i - (T_CURSOR - T_OCAPS + T_CAPS)];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1128,6 +1125,37 @@ int aflag;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return Termcap;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#define TERMCAP_MAX_WIDTH 63
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++DumpTermcap(aflag, f)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++int aflag;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++FILE *f;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ register const char *p, *pe;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int n, col=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((p = index(MakeTermcap(aflag), '=')) == NULL)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ p++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ debug1("DumpTermcap: '%s'\n", p);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /* write termcap entry with wrapping */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while((pe = index(p, ':')))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ n = pe - p + 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if((col > 8) && ((col + n) > TERMCAP_MAX_WIDTH))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fwrite("\\\n\t:", 1, 4, f);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ col = 8;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fwrite(p, 1, n, f);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ col += n;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ p = ++pe;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if(*p)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fwrite(p, 1, strlen(p), f);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fputc('\n', f);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static void
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MakeString(cap, buf, buflen, s)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ char *cap, *buf;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.17.2 (Apple Git-113)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/sysutils/screen/files/patch-panic-fix.diff b/sysutils/screen/files/patch-panic-fix.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..5f619ec
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/sysutils/screen/files/patch-panic-fix.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,140 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Prevent Panic causing Panic, and children removing sockets
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* Set eff_uid/eff_gid after setuid/setgid to prevent nested Panic in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MakeClientSocket which calls xseteuid(eff_uid=0) - results in nested
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Panic and SendErrorMsg not getting sent.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* Set ServerSocket to -1 after fork so that child Panic doesn't
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ remove socket in eexit.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* Fix descriptor leak if fork fails
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Fixes screen bug: https://savannah.gnu.org/bugs/?55511
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Signed-off-by: Scott Shambarger <devel@shambarger.net>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- attacher.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ attacher.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -55,6 +55,8 @@ static sigret_t AttacherChld __P(SIGPROTOARG);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static sigret_t AttachSigCont __P(SIGPROTOARG);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern int real_uid, real_gid, eff_uid, eff_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extern int ServerSocket;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extern struct display *displays;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern char *SockName, *SockMatch, SockPath[];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern char HostName[];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern struct passwd *ppp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -307,9 +309,9 @@ int how;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xseteuid(real_uid); /* multi_uid, allow backend to send signals */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ eff_uid = real_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (setgid(real_gid))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Panic(errno, "setgid");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- eff_uid = real_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ eff_gid = real_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ debug2("Attach: uid %d euid %d\n", (int)getuid(), (int)geteuid());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -737,6 +739,8 @@ LockTerminal()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ((pid = fork()) == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Child */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ displays = 0; /* beware of Panic() */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ServerSocket = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (setgid(real_gid))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Panic(errno, "setgid");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef MULTIUSER
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- display.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ display.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -102,6 +102,7 @@ extern struct winsize glwz;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern char **NewEnv;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern int real_uid, real_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extern int ServerSocket, eff_uid, eff_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -3997,11 +3998,14 @@ char **cmdv;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case 0:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ displays = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ServerSocket = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef SIGPIPE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ signal(SIGPIPE, SIG_DFL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (setgid(real_gid) || setuid(real_uid))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Panic(errno, "setuid/setgid");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ eff_uid = real_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ eff_gid = real_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ brktty(D_userfd);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ freetty();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef DEBUG
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- fileio.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ fileio.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -42,6 +42,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern struct display *display, *displays;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern struct win *fore;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern struct layer *flayer;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extern int ServerSocket;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern int real_uid, eff_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern int real_gid, eff_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern char *extra_incap, *extra_outcap;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -704,7 +705,7 @@ int printpipe(struct win *p, char *cmd) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case 0:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ display = p->w_pdisplay;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ displays = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ServerSocket = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef DEBUG
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (dfp && dfp != stderr)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fclose(dfp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -714,6 +715,8 @@ int printpipe(struct win *p, char *cmd) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ closeallfiles(0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (setgid(real_gid) || setuid(real_uid))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Panic(errno, "printpipe setuid");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ eff_uid = real_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ eff_gid = real_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef SIGPIPE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ signal(SIGPIPE, SIG_DFL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -741,6 +744,7 @@ int readpipe(char **cmdv) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case 0:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ displays = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ServerSocket = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef DEBUG
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (dfp && dfp != stderr)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fclose(dfp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -756,6 +760,8 @@ int readpipe(char **cmdv) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ close(1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Panic(errno, "setuid/setgid");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ eff_uid = real_uid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ eff_gid = real_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef SIGPIPE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ signal(SIGPIPE, SIG_DFL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- window.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ window.c
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -55,6 +55,7 @@ extern char *screenlogfile;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern char HostName[];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern int TtyMode;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern int SilenceWait;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++extern int ServerSocket;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern int real_uid, real_gid, eff_uid, eff_gid;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern char Termcap[];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ extern char **NewEnv;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1253,6 +1254,7 @@ char **args, *ttyn;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case -1:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Msg(errno, "fork");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ close(slave);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ case 0:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ signal(SIGHUP, SIG_DFL);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1271,6 +1273,7 @@ char **args, *ttyn;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ displays = 0; /* beware of Panic() */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ServerSocket = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (setgid(real_gid) || setuid(real_uid))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Panic(errno, "Setuid/gid");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ eff_uid = real_uid;
</span></pre><pre style='margin:0'>
</pre>