summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Christoph Nordholz <hesso@pool.math.tu-berlin.de>2007-08-09 22:51:19 +0200
committerAxel Beckert <abe@deuxchevaux.org>2011-09-03 14:05:30 +0200
commit36d81cb7e914b53be85296259c8d2c82d455fec2 (patch)
treeb1d8eff036f2a3632462b2e9772633359d262068
parentbec2516a6e63af9b2052e9cb60f9d399713083ef (diff)
downloadscreen-36d81cb7e914b53be85296259c8d2c82d455fec2.tar.gz
Imported Debian patch 4.0.3-3debian/4.0.3-3
-rw-r--r--debian/README.Debian13
-rw-r--r--debian/changelog24
-rw-r--r--debian/dirs1
-rw-r--r--debian/patches/00list8
-rw-r--r--debian/patches/14more_maxstr.dpatch21
-rw-r--r--debian/patches/14size_matters.dpatch71
-rw-r--r--debian/patches/15manpage_typos.dpatch22
-rw-r--r--debian/patches/19flowcontrol_lockup.dpatch71
-rw-r--r--debian/patches/21manpage_nethack_activation.dpatch31
-rw-r--r--debian/patches/22no_public_exchange.dpatch27
-rw-r--r--debian/patches/23exitcode_q_ls.dpatch24
-rw-r--r--debian/patches/24option_parser.dpatch18
-rw-r--r--debian/patches/50EXP_tilde_expansion.dpatch67
-rwxr-xr-xdebian/rules2
14 files changed, 367 insertions, 33 deletions
diff --git a/debian/README.Debian b/debian/README.Debian
index 00078db..beec65a 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -75,3 +75,16 @@ A: Firstly look for the same question in FAQ.gz. If the problem persists:
sshd with a crontab entry or similar magic if ssh is your only way to access
the box.)
+
+Q: Multiuser mode is not working - how can I enable it?
+
+A: Screen has to be setuid root to accomplish this. (Note the security implications
+ this has!) If you still want to enable the feature, enter the following commands:
+
+] dpkg-statoverride --add root utmp 4755 /usr/bin/screen
+] chmod 0755 /var/run/screen
+
+ dpkg-statoverride will make sure that the modified permissions remain in effect
+ even if a new version of the screen package is installed. /var/run/screen will
+ be automatically recreated with the proper permissions if the directory lives
+ on volatile storage (doesn't persist between subsequent reboots).
diff --git a/debian/changelog b/debian/changelog
index da348c5..5acfe3a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,27 @@
+screen (4.0.3-3) unstable; urgency=low
+
+ * Take 3: The "less bugreports than upstream" release. Whew.
+ * Add full tilde expansion to the builtin 'source' command. Inspired by
+ a patch by Nico Golde. Thanks! Closes: #308818.
+ * Add a kluge to prevent screen from locking up when doing strange things
+ with xon and flow control enabled. Still waiting for upstream to properly
+ fix this problem, so this only addresses: #157873.
+ * Extend the documentation about the strange activation of the nethack
+ feature. Closes: #205531.
+ * Don't create /tmp/screen-exchange with default mode 0666. Closes: #433338.
+ * Add a Q&A pair to README.Debian on how to enable the multiuser feature.
+ The problem is mentioned in the manpage under '-r', too, so I consider this
+ sufficiently documented now. Closes: #92036.
+ * Fix the exitcode mess of '-q -ls' (and its combinations with -d, -r and -x)
+ to keep the promises the manpage makes. Doing this on my own, no comment
+ from upstream yet. Closes: #426328.
+ * More documentation typo fixes.
+ * Properly parse the long commandline options like '-wipe'. Don't accept
+ as soon as it's unambiguous - this is not getopt(). Closes: #222023.
+ * Increase the maximum length of the input buffer (C-a :). Closes: #379384.
+
+ -- Jan Christoph Nordholz <hesso@pool.math.tu-berlin.de> Thu, 09 Aug 2007 22:51:19 +0200
+
screen (4.0.3-2) unstable; urgency=low
* Overhaul, Take 2: The "let -1 migrate to testing first" release.
diff --git a/debian/dirs b/debian/dirs
index a0a9128..ee19d5d 100644
--- a/debian/dirs
+++ b/debian/dirs
@@ -1,2 +1 @@
etc
-var/run/screen
diff --git a/debian/patches/00list b/debian/patches/00list
index 9b08466..78955c3 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -7,9 +7,15 @@
11replace_doc_paths
12fix_texinfo_syntax
13split_info_files
-14more_maxstr
+14size_matters
15manpage_typos
16fix_gcc_warnings
17manpage_sessionname_warning
18manpage_maxwin_limit
+19flowcontrol_lockup
20defmonitor
+21manpage_nethack_activation
+22no_public_exchange
+23exitcode_q_ls
+24option_parser
+50EXP_tilde_expansion
diff --git a/debian/patches/14more_maxstr.dpatch b/debian/patches/14more_maxstr.dpatch
deleted file mode 100644
index a2a2afe..0000000
--- a/debian/patches/14more_maxstr.dpatch
+++ /dev/null
@@ -1,21 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 14more_maxstr.dpatch by <hesso@pool.math.tu-berlin.de>
-##
-## DP: Increase the MAXSTR macro. It is used in a dozen places to
-## DP: allocate static string buffers, most of them temporarily on
-## DP: the stack. Switching all those to dynamic allocation ain't
-## DP: worth the effort, and given this usage pattern multiplying
-## DP: by 3 doesn't noticeably increase the memory footprint.
-
-@DPATCH@
---- screen-4.0.3.orig/screen.h 2007-07-31 00:55:30.000000000 +0200
-+++ screen-4.0.3/screen.h 2007-07-31 00:55:39.000000000 +0200
-@@ -86,7 +86,7 @@
-
- #define Ctrl(c) ((c)&037)
-
--#define MAXSTR 256
-+#define MAXSTR 768
- #define MAXARGS 64
- #define MSGWAIT 5
- #define MSGMINWAIT 1
diff --git a/debian/patches/14size_matters.dpatch b/debian/patches/14size_matters.dpatch
new file mode 100644
index 0000000..ca167e5
--- /dev/null
+++ b/debian/patches/14size_matters.dpatch
@@ -0,0 +1,71 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 14size_matters.dpatch by <hesso@pool.math.tu-berlin.de>
+##
+## DP: * Increase the MAXSTR macro to suit present-day needs.
+## DP: * Increase the maximum length of the input line buffer likewise.
+
+@DPATCH@
+--- screen-4.0.3.orig/screen.h 2007-07-31 00:55:30.000000000 +0200
++++ screen-4.0.3/screen.h 2007-07-31 00:55:39.000000000 +0200
+@@ -86,7 +86,7 @@
+
+ #define Ctrl(c) ((c)&037)
+
+-#define MAXSTR 256
++#define MAXSTR 768
+ #define MAXARGS 64
+ #define MSGWAIT 5
+ #define MSGMINWAIT 1
+--- screen-4.0.3.orig/input.c 2007-08-09 18:29:57.000000000 +0200
++++ screen-4.0.3/input.c 2007-08-09 18:30:54.000000000 +0200
+@@ -38,7 +38,7 @@
+
+ struct inpline
+ {
+- char buf[101]; /* text buffer */
++ char buf[MAXSTR+1]; /* text buffer */
+ int len; /* length of the editible string */
+ int pos; /* cursor position in editable string */
+ };
+@@ -49,7 +49,7 @@
+ struct inpdata
+ {
+ struct inpline inp;
+- int inpmaxlen; /* 100, or less, if caller has shorter buffer */
++ int inpmaxlen; /* MAXSTR or less if caller has shorter buffer */
+ char *inpstring; /* the prompt */
+ int inpstringlen; /* length of the prompt */
+ int inpmode; /* INP_NOECHO, INP_RAW, INP_EVERY */
+@@ -116,8 +116,8 @@
+ int maxlen;
+ struct inpdata *inpdata;
+
+- if (len > 100)
+- len = 100;
++ if (len > MAXSTR)
++ len = MAXSTR;
+ if (!(mode & INP_NOECHO))
+ {
+ maxlen = flayer->l_width - 1 - strlen(istr);
+--- screen-4.0.3.orig/window.c 2007-08-09 18:31:24.000000000 +0200
++++ screen-4.0.3/window.c 2007-08-09 18:31:31.000000000 +0200
+@@ -2139,7 +2139,7 @@
+ return;
+ }
+ flayer = &p->w_layer;
+- Input(":", 100, INP_COOKED, zmodem_fin, NULL);
++ Input(":", MAXSTR, INP_COOKED, zmodem_fin, NULL);
+ s = send ? zmodem_sendcmd : zmodem_recvcmd;
+ n = strlen(s);
+ LayProcess(&s, &n);
+--- screen-4.0.3.orig/process.c 2007-08-09 18:31:54.000000000 +0200
++++ screen-4.0.3/process.c 2007-08-09 18:32:00.000000000 +0200
+@@ -1891,7 +1891,7 @@
+ ChangeAKA(fore, *args, strlen(*args));
+ break;
+ case RC_COLON:
+- Input(":", 100, INP_COOKED, Colonfin, NULL);
++ Input(":", MAXSTR, INP_COOKED, Colonfin, NULL);
+ if (*args && **args)
+ {
+ s = *args;
diff --git a/debian/patches/15manpage_typos.dpatch b/debian/patches/15manpage_typos.dpatch
index 93006a1..1eabcb8 100644
--- a/debian/patches/15manpage_typos.dpatch
+++ b/debian/patches/15manpage_typos.dpatch
@@ -4,17 +4,20 @@
## DP: Fix a few typos in the documentation.
@DPATCH@
---- screen-4.0.3.orig/doc/screen.1 2007-07-24 01:37:18.000000000 +0200
-+++ screen-4.0.3/doc/screen.1 2007-07-24 01:37:59.000000000 +0200
-@@ -283,7 +283,7 @@
+--- screen-4.0.3.orig/doc/screen.1 2007-08-09 02:51:38.000000000 +0200
++++ screen-4.0.3/doc/screen.1 2007-08-09 02:52:11.000000000 +0200
+@@ -283,9 +283,9 @@
command.
.TP 5
.BI "\-p " number_or_name
-Preselect a window. This is usefull when you want to reattach to a
+Preselect a window. This is useful when you want to reattach to a
specific windor or you want to send a command via the \*Q-X\*U
- option to a specific window. As with screen's select commant, \*Q-\*U
+-option to a specific window. As with screen's select commant, \*Q-\*U
++option to a specific window. As with screen's select command, \*Q-\*U
selects the blank window. As a special case for reattach, \*Q=\*U
+ brings up the windowlist on the blank window.
+ .TP 5
@@ -3172,7 +3172,7 @@
Specify the transmission of eight (or seven) bits per byte.
.IP "ixon or -ixon"
@@ -24,14 +27,17 @@
Enables (or disables) software flow-control for receiving data.
.IP "istrip or -istrip"
Clear (or keep) the eight bit in each received byte.
---- screen-4.0.3.orig/doc/screen.texinfo 2007-07-24 01:37:18.000000000 +0200
-+++ screen-4.0.3/doc/screen.texinfo 2007-07-24 01:38:15.000000000 +0200
-@@ -345,7 +345,7 @@
+--- screen-4.0.3.orig/doc/screen.texinfo 2007-08-09 02:51:40.000000000 +0200
++++ screen-4.0.3/doc/screen.texinfo 2007-08-09 02:52:17.000000000 +0200
+@@ -345,9 +345,9 @@
@end table
@item -p @var{name_or_number}
-Preselect a window. This is usefull when you want to reattach to a
+Preselect a window. This is useful when you want to reattach to a
specific windor or you want to send a command via the @samp{-X}
- option to a specific window. As with screen's select commant, @samp{-}
+-option to a specific window. As with screen's select commant, @samp{-}
++option to a specific window. As with screen's select command, @samp{-}
selects the blank window. As a special case for reattach, @samp{=}
+ brings up the windowlist on the blank window.
+
diff --git a/debian/patches/19flowcontrol_lockup.dpatch b/debian/patches/19flowcontrol_lockup.dpatch
new file mode 100644
index 0000000..dca2b08
--- /dev/null
+++ b/debian/patches/19flowcontrol_lockup.dpatch
@@ -0,0 +1,71 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 19flowcontrol_lockup.dpatch by <hesso@pool.math.tu-berlin.de>
+##
+## DP: Make Flush() truly non-blocking by employing an extra select().
+## DP: Thus D_userfd is assured to be in non-blocking mode on return
+## DP: (even if the return was premature due to select() timing out),
+## DP: so the SetTTY() call in FreeDisplay() doesn't have to be
+## DP: safeguarded on its own.
+## DP:
+## DP: Note - I'm not satisfied at all with this patch, but I consider
+## DP: it an ugly but working kluge, meant only to stay around as long
+## DP: as upstream hasn't come up with anything better.
+
+@DPATCH@
+--- screen-4.0.3.orig/display.c 2007-08-06 22:22:20.000000000 +0200
++++ screen-4.0.3/display.c 2007-08-06 22:59:29.000000000 +0200
+@@ -3137,6 +3137,8 @@
+ {
+ register int l;
+ register char *p;
++ fd_set fd_s;
++ struct timeval sO;
+
+ ASSERT(display);
+ l = D_obufp - D_obuf;
+@@ -3151,15 +3153,29 @@
+ return;
+ }
+ p = D_obuf;
+- if (fcntl(D_userfd, F_SETFL, 0))
+- debug1("Warning: BLOCK fcntl failed: %d\n", errno);
++ if (fcntl(D_userfd, F_SETFL, FNBLOCK))
++ debug1("Warning: NBLOCK fcntl failed: %d\n", errno);
++ if (D_blocked == 1)
++ D_blocked = 0;
++ D_blocked_fuzz = 0;
+ while (l)
+ {
+- register int wr;
++ register int wr = 0;
++ sO.tv_sec = 5; sO.tv_usec = 0;
++ while (1) {
++ int sR;
++ FD_ZERO(&fd_s);
++ FD_SET(D_userfd, &fd_s);
++ sR = select(D_userfd+1, NULL, &fd_s, NULL, &sO);
++ if (!sR) {
++ debug("Timeout while waiting for display write fd to unblock\n");
++ return;
++ } else if (sR > 0) break;
++ }
+ wr = write(D_userfd, p, l);
+ if (wr <= 0)
+ {
+- if (errno == EINTR)
++ if (errno == EINTR || errno == EAGAIN)
+ continue;
+ debug1("Writing to display: %d\n", errno);
+ wr = l;
+@@ -3172,11 +3188,6 @@
+ }
+ D_obuffree += l;
+ D_obufp = D_obuf;
+- if (fcntl(D_userfd, F_SETFL, FNBLOCK))
+- debug1("Warning: NBLOCK fcntl failed: %d\n", errno);
+- if (D_blocked == 1)
+- D_blocked = 0;
+- D_blocked_fuzz = 0;
+ }
+
+ void
diff --git a/debian/patches/21manpage_nethack_activation.dpatch b/debian/patches/21manpage_nethack_activation.dpatch
new file mode 100644
index 0000000..2ec29e1
--- /dev/null
+++ b/debian/patches/21manpage_nethack_activation.dpatch
@@ -0,0 +1,31 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 21manpage_nethack_activation.dpatch by <hesso@pool.math.tu-berlin.de>
+##
+## DP: Document that there are two possible causes for 'nethack on'
+## DP: being activated by default...
+
+@DPATCH@
+--- screen-4.0.3.orig/doc/screen.1 2007-08-06 23:39:11.000000000 +0200
++++ screen-4.0.3/doc/screen.1 2007-08-06 23:40:24.000000000 +0200
+@@ -2260,7 +2260,8 @@
+ .I screen
+ was compiled with the NETHACK flag defined. The
+ default setting is then determined by the presence of the environment
+-variable $NETHACKOPTIONS.
++variable $NETHACKOPTIONS and the file ~/.nethackrc - if either one is present,
++the default is \fBon\fP.
+ .sp
+ .ne 3
+ .B next
+--- screen-4.0.3.orig/doc/screen.texinfo 2007-08-06 23:39:12.000000000 +0200
++++ screen-4.0.3/doc/screen.texinfo 2007-08-06 23:43:15.000000000 +0200
+@@ -4444,7 +4444,8 @@
+ This option is only available if @code{screen} was compiled with the
+ NETHACK flag defined (@pxref{Installation}). The default setting is then
+ determined by the presence of the environment variable
+-@code{$NETHACKOPTIONS}.
++@code{$NETHACKOPTIONS} and the file @code{~/.nethackrc} - if either one is
++present, the default is @code{on}.
+ @end deffn
+
+ @node Nonblock, Number, Nethack, Miscellaneous
diff --git a/debian/patches/22no_public_exchange.dpatch b/debian/patches/22no_public_exchange.dpatch
new file mode 100644
index 0000000..adfb5bd
--- /dev/null
+++ b/debian/patches/22no_public_exchange.dpatch
@@ -0,0 +1,27 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 22no_public_exchange.dpatch by <hesso@pool.math.tu-berlin.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+--- screen-4.0.3/fileio.cO 2007-08-08 03:12:49.000000000 +0200
++++ screen-4.0.3/fileio.c 2007-08-08 03:18:48.000000000 +0200
+@@ -451,7 +451,17 @@
+ fnbuf[sizeof(fnbuf) - 1] = 0;
+ fn = fnbuf;
+ }
++/**
++ * I consider this 'public exchange file' feature a bad idea, at least
++ * if this is the default case. I really don't like the idea of an admin
++ * copying configuration file snippets around that might get changed
++ * in that buffer file.
++ * Drop the notion of a 'public' exchange file. If someone explictly wants
++ * to share his copy buffer contents, he is free to chmod it after its
++ * creation.
++ * Jan Nordholz <hesso@pool.math.tu-berlin.de>, 2007/08/07
+ public = !strcmp(fn, DEFAULT_BUFFERFILE);
++ */
+ # ifdef HAVE_LSTAT
+ exists = !lstat(fn, &stb);
+ if (public && exists && (S_ISLNK(stb.st_mode) || stb.st_nlink > 1))
diff --git a/debian/patches/23exitcode_q_ls.dpatch b/debian/patches/23exitcode_q_ls.dpatch
new file mode 100644
index 0000000..0b659a8
--- /dev/null
+++ b/debian/patches/23exitcode_q_ls.dpatch
@@ -0,0 +1,24 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 23exitcode_q_ls.dpatch by <hesso@pool.math.tu-berlin.de>
+##
+## DP: Make the exitcode of '-q -ls' and friends ('-qr -ls' and even
+## DP: '-qdr -ls') match the documentation.
+
+@DPATCH@
+--- screen-4.0.3.orig/screen.c 2003-09-08 16:26:41.000000000 +0200
++++ screen-4.0.3/screen.c 2007-08-09 02:11:59.000000000 +0200
+@@ -1057,8 +1057,12 @@
+ eff_uid = real_uid;
+ eff_gid = real_gid;
+ i = FindSocket((int *)NULL, &fo, &oth, SockMatch);
+- if (quietflag)
+- exit(8 + (fo ? ((oth || i) ? 2 : 1) : 0) + i);
++ if (quietflag) {
++ if (rflag)
++ exit(10 + i);
++ else
++ exit(9 + (fo || oth ? 1 : 0) + fo);
++ }
+ if (fo == 0)
+ Panic(0, "No Sockets found in %s.\n", SockPath);
+ Panic(0, "%d Socket%s in %s.\n", fo, fo > 1 ? "s" : "", SockPath);
diff --git a/debian/patches/24option_parser.dpatch b/debian/patches/24option_parser.dpatch
new file mode 100644
index 0000000..8f7962f
--- /dev/null
+++ b/debian/patches/24option_parser.dpatch
@@ -0,0 +1,18 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 24option_parser.dpatch by <hesso@pool.math.tu-berlin.de>
+##
+## DP: This is not getopt() and we don't have two leading dashes, so
+## DP: parse and match the long options in full.
+
+@DPATCH@
+--- screen-4.0.3.orig/screen.c 2007-08-09 18:14:50.000000000 +0200
++++ screen-4.0.3/screen.c 2007-08-09 18:15:57.000000000 +0200
+@@ -619,6 +619,8 @@
+ }
+ break;
+ case 'w':
++ if (strcmp(ap+1, "ipe"))
++ exit_with_usage(myname, "Unknown option %s", --ap);
+ lsflag = 1;
+ wipeflag = 1;
+ if (ac > 1 && !SockMatch)
diff --git a/debian/patches/50EXP_tilde_expansion.dpatch b/debian/patches/50EXP_tilde_expansion.dpatch
new file mode 100644
index 0000000..e0a57a0
--- /dev/null
+++ b/debian/patches/50EXP_tilde_expansion.dpatch
@@ -0,0 +1,67 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 50EXP_tilde_expansion.dpatch by <hesso@pool.math.tu-berlin.de>
+##
+## DP: Add full tilde expansion to the builtin 'source' command.
+
+@DPATCH@
+--- screen-4.0.3.orig/fileio.c 2007-08-06 19:26:00.000000000 +0200
++++ screen-4.0.3/fileio.c 2007-08-06 19:25:42.000000000 +0200
+@@ -24,6 +24,7 @@
+ #include <sys/types.h>
+ #include <fcntl.h>
+ #include <sys/stat.h>
++#include <pwd.h>
+
+ #ifndef SIGINT
+ # include <signal.h>
+@@ -296,9 +297,47 @@
+ Msg(0, "%s: source: recursion limit reached", rc_name);
+ return;
+ }
+- rc_recursion++;
+- FinishRc(rcfilename);
+- rc_recursion--;
++ if (*rcfilename == '~')
++ {
++ char rcfilename_tilde_exp[MAXPATHLEN+1];
++ char *slash_position = strchr(rcfilename, '/');
++ if (slash_position == rcfilename+1)
++ {
++ char *home = getenv("HOME");
++ if (!home)
++ {
++ Msg(0, "%s: source: tilde expansion failed", rc_name);
++ return;
++ }
++ snprintf(rcfilename_tilde_exp, MAXPATHLEN, "%s/%s", home, rcfilename+2);
++ }
++ else if (slash_position)
++ {
++ struct passwd *p;
++ *slash_position = 0;
++ p = getpwnam(rcfilename+1);
++ if (!p)
++ {
++ Msg(0, "%s: source: tilde expansion failed for user %s", rc_name, rcfilename+1);
++ return;
++ }
++ snprintf(rcfilename_tilde_exp, MAXPATHLEN, "%s/%s", p->pw_dir, slash_position+1);
++ }
++ else
++ {
++ Msg(0, "%s: source: illegal tilde expression.", rc_name);
++ return;
++ }
++ rc_recursion++;
++ FinishRc(rcfilename_tilde_exp);
++ rc_recursion--;
++ }
++ else
++ {
++ rc_recursion++;
++ FinishRc(rcfilename);
++ rc_recursion--;
++ }
+ }
+
+
diff --git a/debian/rules b/debian/rules
index 3b96460..affd5a5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -63,8 +63,6 @@ install: build
# make it setgid utmp
chown root:utmp $(ROOT)/usr/bin/screen
chmod 2755 $(ROOT)/usr/bin/screen
- # don't distribute /var/run/screen, it is created in postinst
- rm -rf $(ROOT)/var
# lintian overrides for the setgid bin etc
install -m 755 -d $(ROOT)/usr/share/lintian/overrides
install -m 644 debian/screen.lintian.overrides $(ROOT)/usr/share/lintian/overrides/screen