Commit Graph

644 Commits

Author SHA1 Message Date
Alexander Naumov
7908c33f73 exit_with_usage() return 1 in error case only
"screen -h|--help" should NOT return 1
2022-01-06 21:42:55 +02:00
Alexander Naumov
ba0cf35ad7 remove (unused) variable ‘ip’ 2022-01-06 16:16:31 +02:00
Alexander Naumov
3fd3f96566 COPYNG: http => https update 2022-01-06 03:23:32 +02:00
Alexander Naumov
73a854e13c fix wrong data type (int to char) for is_letter() 2022-01-05 21:50:23 +02:00
Alexander Naumov
669b33c921 update man page for v4.9.0 2022-01-05 17:33:08 +02:00
Michael Schröder
14dcf005db fix combining char handling that could lead to a segfault 2022-01-04 03:34:47 +02:00
Michael Schröder
282ec62662 bugfix CVE-2021-26937
It allows remote attackers to cause a denial of service
(invalid write access and application crash) or possibly
have unspecified other impact via a crafted UTF-8
character sequence.

bugfix: https://savannah.gnu.org/bugs/?60030

Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org>
2022-01-04 03:11:44 +02:00
Michael Witten
99a906805a [PATCH 2/2] trivial: docs: Add missing ')'.
A cross-reference was intended to be placed inside parentheses,
but the closing parenthesis was forgotten; this commit inserts
that missing closing parenthesis.
2020-12-17 11:59:08 +01:00
Michael Witten
8ebf7e2839 [PATCH 1/2] trivial: docs: Fix typo (s/paramter/parameter)
In the description of the 'stuff' command, there
was the typo "paramter"; this commit makes that
word "parameter".
2020-12-17 11:56:45 +01:00
Taj Morton
ae27fef9fb bugfix: option -X ignores specified user in multiuser env
bug #37437

Thanks to Taj Morton
2020-10-20 15:23:46 +02:00
30c9a2a6c1 TERMCAP_BUF is used in place of TERMCAP_BUFSIZE. 2020-04-27 18:12:56 +02:00
Václav Doležal
92e86ba578 Expand d_xtermosc array in struct display
Commit c5db181 expands index range of "typ2" by one without expanding
affected arrays. d_xtermosc in struct display is one of these.

Related: c5db181b6e
  (ansi: add support for xterm OSC 11)
Related: 68386dfb1f
  (Fix out of bounds access when setting w_xtermosc after OSC 49)

Signed-off-by: Václav Doležal <vdolezal@redhat.com>
2020-02-22 22:30:58 +01:00
Amadeusz Sławiński
067c3ebca4 Release v.4.8.0
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
v.4.8.0
2020-02-05 21:23:48 +01:00
Amadeusz Sławiński
0dd53533e2 Increase permitted length of OSC
hyperlink feature used by some terminals requires lots of characters
https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#length-limits
mentions around 2083 characters, set it to a bit more.

Bug: 57718

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2020-02-05 21:05:28 +01:00
Amadeusz Sławiński
68386dfb1f Fix out of bounds access when setting w_xtermosc after OSC 49
echo -e "\e]49\e;                                    \n\ec"
crashes screen.

This happens because 49 is divided by 10 and used as table index
resulting in access to w_xtermosc[4], which is out of bounds with table
itself being size 4. Increase size of table by 1 to 5, which is enough
for all current uses.

As this overwrites memory based on user input it is potential security
issue.

Reported-by: pippin@gimp.org
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2020-02-05 21:02:01 +01:00
Scott Shambarger
de672dcdaf Fix configure check for SELECT_BROKEN
Fixes broken ifdef nesting in confgure.ac when checking for SELECT_BROKEN

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2020-01-31 00:22:09 +01:00
Alexander Naumov
353ca2cd11 Code reformating - tty.sh
Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org>
2020-01-10 23:23:45 +01:00
Stuart Henderson
3d60ad42ea Adding OpenBSD to the BSD list 2020-01-10 21:59:18 +01:00
Alexander Naumov
1e1a5e9e2d Copyright update for 2020 2020-01-10 21:17:10 +01:00
Alexander Naumov
ef151b339e Typo DEBUG 2020-01-10 21:08:45 +01:00
Alexander Naumov
71c14f2345 Fix return code of '--version' and '-v'
Bug #57571
2020-01-10 20:58:39 +01:00
Scott Shambarger
241553f21c Create TERMCAP entries limited to 1023 bytes by default.
TERMCAP_BUF defaults to 1023 to create TERMCAP entries that work on
most systems.  To save space, TERMCAP is unwrapped, and vt220 extra
keys are skipped (unless TERMCAP_BUF > 1023); navigation keys are
still included.  Entries larger than TERMCAP_BUF are now truncated,
and no longer Panic screen.

Termcap entries are still wrapped when saved to a file.

Signed-off-by: Scott Shambarger <devel@shambarger.net>
2019-12-28 13:45:24 +01:00
Christoph Moench-Tegeder
c4a059f117 Fix coredump on xterm and rxvt
Here's the rub: with TERM=xterm (or rxvt, for that matter), Km
("key_mouse", "Mouse event has occured") is not set (and therefore
NULL), but InitTermcap() (termcap.c:230) happily tries to strdup() that,
which gets us that segfault.

As a band-aid, catch that NULL and don't strdup().

Signed-off-by: Marcin Cieślak <saper@saper.info>
2019-12-28 13:43:34 +01:00
Amadeusz Sławiński
09bbd3eff3 Make closeallfiles() faster
Optimize startup time, making closeallfiles() faster, by doing less
system calls. Instead of calling close for each possible file, use
poll() to check if file exist at all. On linux with open file limit set
to 1048576, it should do 1024 poll() calls instead of 1048576 close().

Bug: 55618

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2019-12-28 13:41:29 +01:00
Alexander Naumov
b7a7615084 Using 'https' instead of 'http' 2019-11-09 17:54:26 +01:00
Amadeusz Sławiński
1ca2816117 Release v.4.7.0
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
v.4.7.0
2019-10-02 00:02:48 +02:00
Amadeusz Sławiński
c0349fd511 Update ambiguous and wide characters tables to Unicode 12.1.0
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2019-10-01 23:55:20 +02:00
Amadeusz Sławiński
fad4c29fd9 Fix broken mouse after ncurses 6.1
ncurses 6.1 changed kmous capability from "\e[M" to "\e[<". It seems to
be done to signal that terminal supports sgr mouse mode. screen assumed
that if kmous is set to "\e[M" it is on xterm compatible terminal
anyway, so just dynamically detect which one is used and override
relevant kmapdef.

InitKeytab() is moved, so kmapdef[] can be overriden before
initialization, as InitTermcap() needs to run first, as far as I can
tell this should have no consequences.

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2019-09-07 18:38:55 +02:00
Amadeusz Sławiński
d6e9a6a693 Clean whole buffer if we don't want to parse it
Fixes problem when pressing arrows in some prompts causes arrows to stop
in other places.

For example pressing up arrow in 'kill --confirm' prompt stops up arrow
from working on 'windowlist'

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2019-04-17 20:58:05 +02:00
Alexander Naumov
1e5db24077 Copyright update for 2019 2019-03-29 20:35:44 +01:00
Alexander Naumov
ee2e2254bf Typo in man page
bug #56027
2019-03-29 20:33:09 +01:00
Scott Shambarger
498e53ff09 Fix blanker to work when screen is suid root
* Change RunBlanker to call OpenDevice so permissions on slave
  PTY are correctly set.
* Update handling of file descriptors after fork to be similar to
  ForkWindow on at pty (fixes debug and leaked descriptors)
* DEBUG now creates screen.blanker to debug blanker fork
* Allow display of error message when display blocked by blanker
  (because message is probably from blanker failing to start)

Bug: 55512

Signed-off-by: Scott Shambarger <devel@shambarger.net>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2019-01-27 16:07:57 +01:00
Scott Shambarger
96718a2146 Prevent Panic causing Panic, and children removing sockets
* Set eff_uid/eff_gid after setuid/setgid to prevent nested Panic
  MakeClientSocket calls xseteuid(eff_uid=0) - results in nested
  Panic and SendErrorMsg not getting sent.
* Set ServerSocket to -1 after fork so that child Panic doesn't
  remove socket in eexit.

Bug: 55511

Applied with some modifications

Signed-off-by: Scott Shambarger <devel@shambarger.net>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2019-01-27 16:07:36 +01:00
Václav Doležal
d51308fbff Fix confusing indentation on several places
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2018-11-18 16:01:04 +01:00
Václav Doležal
26e61437ef Fix possible unterminated string
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net
2018-11-18 16:01:00 +01:00
Václav Doležal
61d6955517 Fix for nomem handling in resize.c:ChangeWindowSize()
Move `nomem' label of ChangeWindowSize() to the end of function and
add test for value of `nhlines'

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net
2018-11-18 16:00:56 +01:00
Václav Doležal
10ddd81e20 Revert "those 0 assignment made rest of code totally not working"
This reverts commit ff98d7ff58.

This can potentially cause double-free. `nmlines' and `nhlines'
should be freed in preceding lines.

`nmlines' and `nhlines' are not used in the rest of the function
except in `nomem' label and their valuse are copied into `p', so
their value should be zeroed.

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net
2018-11-18 16:00:51 +01:00
Václav Doležal
14db9f00d3 Fix file descriptor leak
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net
2018-11-18 16:00:47 +01:00
Václav Doležal
bea9483c35 Use memcpy(3) in string substitution
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net
2018-11-18 16:00:42 +01:00
Lubomir Rintel
908458c7c3 ansi: terminate xterm OSC response the same way as the request
There's two way to terinate an OSC: ST (\033\\) or BEL (\a). Use
whatever the original request used instead of always forcing a BEL.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
(cherry picked from commit 11a74b8382)
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net
2018-11-18 16:00:33 +01:00
Lubomir Rintel
c5db181b6e ansi: add support for xterm OSC 11
It allows for getting and setting the background color. Notably, Vim uses
OSC 11 to learn whether it's running on a light or dark colored terminal
and choose a color scheme accordingly.

Tested with gnome-terminal and xterm. When called with "?" argument the
current background color is returned:

  $ echo -ne "\e]11;?\e\\"
  $ 11;rgb:2323/2727/2929

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
(cherry picked from commit 7059bff20a)
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net
2018-11-18 16:00:25 +01:00
Therese Godefroy
ee12d36719 apply patch by Therese fixing some doc issues
This fixes some issues when documentation is generated for online
viewing.
2018-10-12 00:48:30 +02:00
Svyatoslav Mishyn
f96263221b doc: fix typos
Hi there,

just found a few typos, see attachment.

(please, CC me)

Thanks.

--
https://www.juef.space/

From 745ba353867142d3e00f4d2ab06962ba0d3aaaab Mon Sep 17 00:00:00 2001
From: Svyatoslav Mishyn <svyatoslav.mishyn@gmail.com>
Date: Wed, 4 Jul 2018 21:40:48 +0300
Subject: [PATCH] doc: fix typos
2018-07-24 23:19:31 +02:00
Amadeusz Sławiński
26b4c2d790 remove character substitution
it may be not compatible with some man page viewers
2018-06-21 21:47:03 +02:00
Eric S. Raymond
123f7cbbf4 fix man page 2018-06-21 21:41:12 +02:00
Marcin Cieślak
6c880e68a3 manpage: Explain window permissions in a table 2018-05-31 14:38:42 +02:00
Marcin Cieślak
0d9858e71d manpage: Use monospaced font to render example of "displays" 2018-05-31 14:38:34 +02:00
Marcin Cieślak
f891379e02 manpage: Indent both examples for readreg 2018-05-31 14:38:28 +02:00
Marcin Cieślak
a2669fdfa5 manpage: keep nonblock and status parameters on the same line 2018-05-31 14:38:21 +02:00
Marcin Cieślak
e3a4818f6e manpage: explain flow control state indicators with a table 2018-05-31 14:38:15 +02:00