]> git.pld-linux.org Git - packages/screen.git/blame - screen-E3.patch
- unify @direntry formatting (description at 41st column)
[packages/screen.git] / screen-E3.patch
CommitLineData
3c7f1e6c
AM
1commit 0aec2900f63820c3405ba38a4d1cd67cc22f0715
2Author: Miroslav Lichvar <mlichvar@redhat.com>
3Date: Mon Jul 18 17:26:47 2011 +0200
4
5 Clear scrollback buffer when locking terminal
6
7 Linux kernel 3.0 adds a new command to clear the scrollback buffer in
8 the linux console. It's available in the ncurses terminfo entry as
9 extended capability E3. This is useful to prevent an attacker to read
10 content of a locked terminal via Shift-PgUp key.
11
12diff --git a/src/display.c b/src/display.c
13index 5fa11cb..038c435 100644
14--- a/src/display.c
15+++ b/src/display.c
16@@ -3779,4 +3779,10 @@ char **cmdv;
17
18 #endif /* BLANKER_PRG */
19
20+void
21+ClearScrollbackBuffer()
22+{
23+ if (D_CE3)
24+ AddCStr(D_CE3);
25+}
26
27diff --git a/src/extern.h b/src/extern.h
28index c787d99..d3fecf0 100644
29--- a/src/extern.h
30+++ b/src/extern.h
31@@ -316,6 +316,7 @@ extern int color256to88 __P((int));
32 extern void ResetIdle __P((void));
33 extern void KillBlanker __P((void));
34 extern void DisplaySleep1000 __P((int, int));
35+extern void ClearScrollbackBuffer __P((void));
36
37 /* resize.c */
38 extern int ChangeWindowSize __P((struct win *, int, int, int));
39diff --git a/src/screen.c b/src/screen.c
40index cc8f565..3efb67b 100644
41--- a/src/screen.c
42+++ b/src/screen.c
43@@ -1967,6 +1967,7 @@ int mode;
44 #endif
45 case D_LOCK:
46 ClearAll();
47+ ClearScrollbackBuffer();
48 sign = SIG_LOCK;
49 /* tell attacher to lock terminal with a lockprg. */
50 break;
51diff --git a/src/term.c b/src/term.c
52index 991de1b..7485900 100644
53--- a/src/term.c
54+++ b/src/term.c
55@@ -83,6 +83,7 @@ struct term term[T_N] =
56 { "CD", T_STR },
57 { "ce", T_STR },
58 { "cb", T_STR },
59+ { "E3", T_STR },
60
61 /* initialise */
62 { "is", T_STR },
This page took 0.029887 seconds and 4 git commands to generate.