* 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)
* Allow display of error message when display blocked by blanker
(because message is probably from blanker failing to start)
Bug: 55512
Cherry-picked form screen-v4, with some modifications
Signed-off-by: Scott Shambarger <devel@shambarger.net>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
* 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
Cherry-picked from screen-v4 with some modifications
Signed-off-by: Scott Shambarger <devel@shambarger.net>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
we just returned without freeing 's' and resetting EffectiveAclUser,
which per comment at the beginning should be reset
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
60 characters is plenty enough for reason string
window.c: In function ‘WindowDied’:
window.c:1941:33: warning: ‘%s’ directive writing up to 99 bytes into a region of size 86 [-Wformat-overflow=]
sprintf(buf, "\n\r=== Command %s (%s) ===", reason, s ? s : "?");
^~ ~~~~~~
window.c:1941:16: note: assuming directive output of 1 byte
sprintf(buf, "\n\r=== Command %s (%s) ===", reason, s ? s : "?");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:862,
from logfile.h:33,
from window.h:39,
from window.c:34:
/usr/include/bits/stdio2.h:33:10: note: ‘__builtin___sprintf_chk’ output 22 or more bytes (assuming 122) into a destination of size 100
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
it's still a hack, because to do proper detection we would need to
migrate to terminfo functions instead of termcap
Bug: 52667
Bug: 54989
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Windowlist has two toggles that affect its output: the list can be sorted in
either index or MRU order, and the list can contain either just immediate
children windows of all descendant windows. Since window groups use the same
code for their own output, they also support these toggles.
However, in the current code base, these toggles are reset to index ordering and
display of immediate children only every time a particular window group is
swapped out of and back into a pane.
Amadeusz:
added commit message + changed variable names + some reformatting
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
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
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
This seems to be caused by faulty pointer/buffer-length
tracking. Pointer position 'p', meant to be incremented
by the length of the string written to the buffer, is
instead incremented by (length of the buffer - length of
the string written to the buffer), quickly shooting past
the end of the allocated buffer space.
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
Remove "allbox" tbl option from large keybinding table.
When formatting for print, large tbl tables need to be handled
specially to split nicely across the pages; instead we
just add horizontal lines and we let them overflow the pages.
The input translation table seems to fit nicely on one page
and is left as is with the "allbox" option.
bindkey examples seem to be glued to their following descriptions.
This looks bad in the printable versions, so give it some space.
Alternatively we could possibly reverse the indentation and use
something like this:
bindkey -d
Show all of the default key bindings.
but this is inconsistent with other examples.
"Keypad =" table entry had a double horizontal line instead of a single "="
when printed with troff.
From "Tbl -- A Program to Format Tables" by M. E. Lesk:
Single column horizontal lines
-- An input table entry containing only the character (...) = is
taken to be a single or double line extending the full width of the
column. Such lines are extended to meet horizontal or vertical
lines adjoining this column. To obtain these characters explicitly
in a column, either precede them by \& or follow them by a space
before the usual tab or newline.
screen.c: In function ‘main’:
screen.c:940:4: warning: ‘strncpy’ output truncated before terminating nul copying 6 bytes from a string of the same length [-Wstringop-truncation]
strncpy(ap, "SCREEN", 6); /* name this process "SCREEN-BACKEND" */
^~~~~~~~~~~~~~~~~~~~~~~~
this is readded based on code which already was there
in older versions
we need TIOCSCTTY ioctl to set session control terminal
I'm not adding any system ifdefs, as it doesn't seem
like it should break anything on linux
Bug: 49170
In file included from /usr/include/string.h:494,
from os.h:41,
from screen.h:37,
from winmsgbuf.h:28,
from process.h:4,
from process.c:36:
In function ‘strncpy’,
inlined from ‘ShowDInfo’ at process.c:6241:3:
/usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ offset [386, 513] is out of the bounds [0, 128] of object ‘buf’ with type ‘char[128]’ [-Warray-bounds]
return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
process.c: In function ‘ShowDInfo’:
process.c:6231:7: note: ‘buf’ declared here
char buf[128], *p;
^~~
later in code we set l = 512, but buffer is only 128, increase buffer
size to 512
help.c: In function ‘helppage’:
help.c:222:52: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 220 and 228 [-Wformat-overflow=]
sprintf(cbuf, "Command key: %s Literal %s: %s", Esc_buf, Esc_buf, buf);
^~ ~~~
In file included from /usr/include/stdio.h:862,
from os.h:32,
from acls.h:32,
from comm.h:8,
from help.h:4,
from help.c:34:
/usr/include/bits/stdio2.h:33:10: note: ‘__builtin___sprintf_chk’ output between 29 and 292 bytes into a destination of size 256
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cbuf has size of 256, while Esc_buf has size of 5 and buf of 256
so printing literal string + those others may end up with longer string
in cbuf
fix that by increasing cbuf size