summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Release v.4.6.2v.4.6.2Amadeusz Sławiński2017-10-234-7/+14
| | | | Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
* Replace the use of read /dev/kmem by a syscall for AIX platformsAlexander Naumov2017-10-041-0/+40
| | | | bug #49148
* Revert "fix restoring cursor position after leaving altscreen"Amadeusz Sławiński2017-10-032-9/+1
| | | | | | | | | This caused degrade when restoring cursor in other cases, revert, while looking for better fix This reverts commit 8062db33b87ed86ec54222c83babbf1aa5866ec9. Bug: 51832
* termcap.c: in FreeTransTable set D_xtable to NULLNate Clark2017-09-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After freeing D_xtable set the value to NULL so that checks of D_xtable return false. RAW_PUTCHAR can cause a segfault if invoked after FreeTransTable. This can happen in FreeDisplay when SetTTY encounters an error performing an ioctl on the tty. 0 0x000055583e7032a4 in RAW_PUTCHAR (c=110) at display.c:656 1 0x000055583e6cbe4c in PutWinMsg (s=0x55583e932801 <winmsg_buf+1> "clark-dt -* ", s@entry=0x55583e932800 <winmsg_buf> "nclark-dt -* ", start=<optimized out>, start@entry=0, max=40, max@entry=49) at screen.c:3053 2 0x000055583e7003f6 in PrePutWinMsg (s=0x55583e932800 <winmsg_buf> "nclark-dt -* ", start=0, max=49) at display.c:2174 3 0x000055583e705339 in RefreshLine (y=65, from=<optimized out>, to=48, isblank=0) at display.c:2399 4 0x000055583e70630c in MakeStatus (msg=0x7ffeaa03d7d0 "SetTTY (fd 3): ioctl failed: Input/output error") at display.c:2056 5 0x000055583e6c8a68 in Msg (err=<optimized out>, fmt=<optimized out>) at screen.c:2091 6 0x000055583e6c83a1 in CoreDump (sigsig=<optimized out>) at screen.c:1664 7 <signal handler called> 8 0x000055583e7032a4 in RAW_PUTCHAR (c=110) at display.c:656 9 0x000055583e6cbe4c in PutWinMsg (s=0x55583e932801 <winmsg_buf+1> "clark-dt -* ", s@entry=0x55583e932800 <winmsg_buf> "nclark-dt -* ", start=<optimized out>, start@entry=0, max=40) at screen.c:3053 10 0x000055583e700443 in PrePutWinMsg (s=0x55583e932800 <winmsg_buf> "nclark-dt -* ", start=0, max=<optimized out>) at display.c:2165 11 0x000055583e705339 in RefreshLine (y=65, from=<optimized out>, to=48, isblank=0) at display.c:2399 12 0x000055583e70630c in MakeStatus (msg=0x7ffeaa040780 "SetTTY (fd 3): ioctl failed: Input/output error") at display.c:2056 13 0x000055583e6c8a68 in Msg (err=<optimized out>, fmt=<optimized out>, fmt@entry=0x55583e719f41 "SetTTY (fd %d): ioctl failed") at screen.c:2091 14 0x000055583e6dfadc in SetTTY (fd=<optimized out>, mp=<optimized out>) at tty.c:624 15 0x000055583e707d08 in FreeDisplay () at display.c:340 16 0x000055583e6c8612 in Detach (mode=mode@entry=2) at screen.c:2000 17 0x000055583e6dbb52 in FinishDetach (m=0x55583e933b80 <m>) at socket.c:1607 18 0x000055583e6ddcd5 in FinishAttach (m=m@entry=0x55583e933b80 <m>) at socket.c:1424 19 0x000055583e6de531 in ReceiveMsg () at socket.c:1235 20 0x000055583e711583 in sched () at sched.c:237 21 0x000055583e6c7113 in main (ac=0, av=<optimized out>) at screen.c:1466 Bug: 52133 Signed-off-by: Nate Clark <nate@neworld.us>
* documentation fix for command "resize"Curtis Brown2017-09-262-34/+182
|
* Remove documentation for defzombie setting which doesn't existJon Jensen2017-08-173-18/+4
|
* stop clobbering display variableAmadeusz Sławiński2017-08-021-2/+0
| | | | | | | | | not sure why it was done, but it seems to serve no functional purpose at all and breaks displaying flags in :windowlist display is used by AddWindowFlags to check whether we should show some of flags and they are not shown when display == 0 Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
* check if display exists before dereferencing itAmadeusz Sławiński2017-08-021-1/+1
| | | | | | | Bug: 43054 Bug: 51500 Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
* Release v.4.6.1v.4.6.1Amadeusz Sławiński2017-07-104-4/+10
|
* fix segfault when querying info on nonUTF screenAmadeusz Sławiński2017-07-101-1/+1
| | | | Bug: 51402
* Fix parallel make installMatt Whitlock2017-07-011-1/+1
| | | | | Fixes: https://bugs.gentoo.org/show_bug.cgi?id=611130
* restore missing code which was wrongly removedClark Wang2017-07-011-0/+6
| | | | | fixes regression introduced by migrating from pipe to sockets http://lists.gnu.org/archive/html/screen-users/2017-06/msg00001.html
* Release v4.6.0v.4.6.0Amadeusz Sławiński2017-06-284-9/+16
|
* begin viewing scrollback buffer at the first line of output instead of at ↵Guo Ci2017-06-225-4/+12
| | | | | | | | | | | | | | | | | | | | | | the start of the scrollback buffer This issue has been discussed before: https://bbs.archlinux.org/viewtopic.php?id=108640 Copy mode and “hardcopy -h” always begin at the start of the scrollback buffer. If a user sets a large scrollback limit with little output, then copy mode and the file written by “hardcopy -h” will begin with many blank lines before the first line of output. The attached patch limits the scrollback buffer traversal to begin at the first line of output, instead of the beginning of the scrollback buffer. Also, code for moving to %age of buffer is changed to use float division so that two different rep_cnt will not jump to the same location, except for buffers less than 100 lines. Previously, the computed line number is rounded down to the nearest 100th due to integer division. Bug: 49377
* update unicode wide tablesBrian De Wolf2017-06-211-66/+292
| | | | Bug: 50044
* Add more serial speedsAmadeusz Sławiński2017-06-091-26/+37
| | | | | make idx unique reorder from highest speed to lowest
* screen: don't stat("")Christian Brauner2017-05-301-1/+2
| | | | Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
* fix typosAmadeusz Sławiński2017-04-182-3/+3
|
* add compat layer to handle both fifos and socketsChristian Brauner2017-04-188-352/+365
| | | | | | | | | | So far screen could only support either sockets or fifos but not both. This proved to be a blocker for any upgrade. This adds a compatibility layer to screen v4 to support both sockets and fifos at the same time. The strategy here is to only support fifos for legacy sessions that already exist. All new sessions will use sockets by default. Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
* fix restoring cursor position after leaving altscreenAmadeusz Sławiński2017-04-062-1/+9
| | | | | | When swapping to altscreen, also swap cursor position Bug: 49883
* screen: handle pts devices in different namespacesChristian Brauner2017-04-066-73/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various programs that deal with namespaces will use pty devices that exist in another namespace. One obvious candidate are containers. So far ttyname() was incorrectly handling this case because the pts device stems from the host and thus cannot be found amongst the current namespace's /dev/pts/<n> entries. Serge Hallyn and I recently upstreamed patches to glibc that allow ttyname{_r}() to correctly handle this case. At a minimum, ttyname{_r}() will set errno to ENODEV in case it finds that the /dev/pts/<n> device that the symlink points to exists in another namespace. (The next comment is a little longer but tries to ensure that one can still understand what is going on after some time has passed.) In case we detect that ttyname{_r}() returns NULL and sets errno to ENODEV we have ample reason to assume that the pts device exists in a different namespace. In this case, the code will set a global flag indicating this case to true. Furthermore, all operations (e.g. chmod(), chown(), etc.) will now need to operate on the symbolic link /proc/self/fd/0 directly. While this sounds straightforward, it becomes difficult to handle this case correctly when we reattach to an already existing screen session from a different pts device than the original one. Let's look at the general reattach logic a little closer: Assume we are running a shell that uses a pts device from a different namespace: root@zest1:~# ls -al /proc/self/fd/ total 0 dr-x------ 2 root root 0 Apr 2 20:22 . dr-xr-xr-x 9 root root 0 Apr 2 20:22 .. lrwx------ 1 root root 64 Apr 2 20:22 0 -> /dev/pts/6 lrwx------ 1 root root 64 Apr 2 20:22 1 -> /dev/pts/6 lrwx------ 1 root root 64 Apr 2 20:22 2 -> /dev/pts/6 l-wx------ 1 root root 64 Apr 2 20:22 3 -> pipe:[3067913] lr-x------ 1 root root 64 Apr 2 20:22 4 -> /proc/27413/fd lrwx------ 1 root root 64 Apr 2 20:22 9 -> socket:[32944] root@zest1:~# ls -al /dev/pts/ total 0 drwxr-xr-x 2 root root 0 Mar 30 17:55 . drwxr-xr-x 8 root root 580 Mar 30 17:55 .. crw--w---- 1 root tty 136, 0 Mar 30 17:55 0 crw--w---- 1 root tty 136, 1 Mar 30 17:55 1 crw--w---- 1 root tty 136, 2 Mar 30 17:55 2 crw--w---- 1 root tty 136, 3 Mar 30 17:55 3 crw--w---- 1 root tty 136, 4 Mar 30 17:55 4 crw-rw-rw- 1 root root 5, 2 Apr 2 20:22 ptmx (As one can see /dev/pts/6 does not exist in the current namespace.) Now, start a screen session in this shell. In this case this patch will have screen directly operate on /proc/self/fd/0. Let's look at the attach case. When we attach to an existing screen session where the associated pts device lives in another namespace we need a way to uniquely identify the pts device that is used and also need a way to get a valid fd when we need one. This patch solves this by ensuring that a valid file descriptor to the pts device is sent via a unix socket and SCM_RIGHTS to the socket and display handling part of screen. However, screen also sends around the name of the associated pts device or, in the case where the pts device exists in another namespace, the symlink /proc/self/fd/0. But after having sent the fd this part of the codebase cannot simply operate on /proc/self/fd/0 since it very likely refers to a different file. So we need to operate on /proc/self/fd/<fd-sent-via-SCM_RIGHTS> but also need to ensure that we haven't been tricked into operating on a tampered with file or device. So we cannot simply sent /proc/self/fd/0 via the unix socket. Instead we read the contents of the symbolic link /proc/self/fd/0 in the main function and sent it via the unix socket. Then in the socket and display handling part of screen, we read the contents of the /proc/self/fd/<fd-sent-via-SCM_RIGHTS> as well and compare the pts device names. If they match we know that everything is well. However, now we also need to update any tty handling code to directly operate on /proc/self/fd/<fd-sent-via-SCM_RIGHTS>. Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
* handle pty device from different namespaceChristian Brauner2017-03-241-2/+10
| | | | | | | | | | | | | | Various programs that deal with namespaces will use pty devices that exist in another namespace. One obvious candiate are containers. So far ttyname() was incorrectly handling this case because the pts device stems from the host and thus cannot be found amongst the current namespace's /dev/pts/<n> entries. Serge Hallyn and I recently upstreamed patches to glibc that allow ttyname{_r}() to correctly handle this case. At a minimum, ttyname{_r}() will set errno to ENODEV in case it finds that the /dev/pts/<n> device that the symlink points to exists in another namespace. This commit will allow screen to handle this case and behave correctly in a container. Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
* fix mixing external & internal TERMSamuel Thibault2017-03-221-0/+2
| | | | Bug: 50588
* Cleanup patch for man pageEric S. Raymond2017-03-011-1165/+1262
|
* [PATCH] fix texinfo syntax errorsAndreas Stieger2017-02-281-2/+2
| | | | thanks to Andreas Stieger <astieger@suse.com>
* Release v4.5.1v.4.5.1Alexander Naumov2017-02-225-75/+86
|
* bugfix: Screen doesn't build on SunOSAlexander Naumov2017-02-151-1/+4
| | | | bug #50089
* limits.h => PATH_MAX for SunOSAlexander Naumov2017-02-131-0/+1
| | | | bug #50089
* "-Logfile" set logfile only (doesn't turn on logging)Alexander Naumov2017-02-081-1/+1
|
* misprint in help.cAlexander Naumov2017-02-081-1/+1
|
* adding "-Logfile" option to helpAlexander Naumov2017-02-081-1/+2
|
* update documentation "-L logfile" -> "-Logfile"Amadeusz Sławiński2017-02-072-7/+8
|
* make -L logfile into separate -Logfile parameterAmadeusz Sławiński2017-02-071-15/+9
| | | | | | | | | Also drop file checking, as it became clear that it doesn't make much sense for example with "-Logfile 'logfile.%n'" each window would have it's own logfile and in theory we would need to check them all and still someone could prevent us to open logfile at runtime due to creating conflicting file with properly crafted permissions, before we open a window.
* CVE-2017-5618: secure open/close logfileAlexander Naumov2017-02-062-7/+20
| | | | | | bug #50142 Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org>
* Fixed some typos found by LintianAxel Beckert2017-02-032-4/+4
| | | | | Author: Axel Beckert <abe@debian.org> Bug-Debian: https://bugs.debian.org/741141
* Z0width & Z1width are only assigned once, make them constAmadeusz Sławiński2017-02-015-7/+6
| | | | | | | It's modified cherry-pick of f4e6265c8be5e74590b7bf24fe5250e70283ccb0 from master branch. Fix: 50197
* Adding "-L logfile" option for setting new logfile's nameAlexander Naumov2017-01-262-16/+16
| | | | | Now it's possible to set your own lofile name with this option ONLY. It fixes also API of old versions.
* Replace screenlogfile only if it's neededAlexander Naumov2017-01-241-5/+6
|
* Division by zero! Solution neededAlexander Naumov2017-01-211-1/+6
|
* Value stored to 'i' during its initialization is never readAlexander Naumov2017-01-211-1/+1
| | | | i.e. we initialize 'i' twice (next line)
* Value stored to 'av' during its initialization is never readAlexander Naumov2017-01-211-1/+1
| | | | i.e. we initialize 'av' twice
* Value stored to 'num' is never readAlexander Naumov2017-01-211-1/+1
|
* Ignore logfile's name that begins with the "-" symbolAlexander Naumov2017-01-213-4/+6
| | | | | | | | | | | | | | | | | | This fixes API: To enable logging we use -L option. But in case of default logfile name (screenlog.0) we will need to define it anyway. Because screen will try to interpret next option as a parameter for -L option (which is logfile name). It will fails ALWAYS, because next parameter will always start with "-" symbol... what is not permited for logfile name of course. For example: $ screen -L -D -m ./configure In this case logfile name is screenlog.0, because "-D" will not be interpreted by screen as a name of logfile. Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org>
* variable 'oldtop' set but not usedAlexander Naumov2017-01-191-2/+1
|
* Refactoring + 'olddisplay' is never read (LayPause)Alexander Naumov2017-01-191-815/+693
|
* [PATCH] restore comparision not to be bitwiseElan Ruusamäe2017-01-191-1/+1
|
* Release v4.5.0v.4.5.0Alexander Naumov2016-12-074-11/+20
| | | | Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org>
* Build bugfix for AIXAlexander Naumov2016-12-063-1/+8
| | | | | bug #49149 Thanks to Tony Reix
* Help message knows about log filename (-L)Alexander Naumov2016-12-061-1/+1
| | | | Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org>
* Code reformating (layout.c + logfile.c)Alexander Naumov2016-11-062-290/+185
| | | | Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org>