Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 573106 Details for
Bug 807369
RFE: Clear screen including scroll-back buffer after locking session
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Implement console erase
0001-Implement-console-erase.patch (text/plain), 3.11 KB, created by
Petr Pisar
on 2012-03-27 15:40:33 UTC
(
hide
)
Description:
Implement console erase
Filename:
MIME Type:
Creator:
Petr Pisar
Created:
2012-03-27 15:40:33 UTC
Size:
3.11 KB
patch
obsolete
>From bc41a94cab0617faf925210581d07d28e2d992a3 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> >Date: Tue, 27 Mar 2012 17:20:39 +0200 >Subject: [PATCH] Implement console erase > >New options -e, --erase clear console content after locking the >session to prevent bad guys from reading sensitive data while user is >away from keyboard. >--- > help.c | 2 ++ > vlock.1 | 4 ++++ > vlock.c | 15 ++++++++++++++- > 3 files changed, 20 insertions(+), 1 deletions(-) > >diff --git a/help.c b/help.c >index 95f5154..1e8925f 100644 >--- a/help.c >+++ b/help.c >@@ -26,6 +26,8 @@ void print_help(int exitcode) { > " switch to other virtual consoles.\n" > "-a or --all: lock all virtual consoles by preventing other users\n" > " from switching virtual consoles.\n" >+ "-e or --erase: erase current virtual console content\n" >+ " from switching virtual consoles.\n" > "-v or --version: Print the version number of vlock and exit.\n" > "-h or --help: Print this help message and exit.\n" > ); >diff --git a/vlock.1 b/vlock.1 >index 9a5f990..5c8ce5f 100644 >--- a/vlock.1 >+++ b/vlock.1 >@@ -38,6 +38,10 @@ Lock all console sessions and disable VC switching. > .IP > Lock the current session (this is the default). > .PP >+.B -e,--erase >+.IP >+Erase current console content to prevent from leaking sensitive data. >+.PP > .B -h,--help > .IP > Print a brief help message. >diff --git a/vlock.c b/vlock.c >index 010158b..1de8d65 100644 >--- a/vlock.c >+++ b/vlock.c >@@ -29,6 +29,9 @@ > /* This determines whether the default behavior is to lock only the */ > /* current VT or all of them. 0 means current, 1 means all. */ > int o_lock_all = 0; >+ /* This determines whether to erase terminal content after the locking. >+ * 0 means do not erase, 1 means to erase. */ >+ int o_erase_terminal = 0; > > /* Other globals */ > struct vt_mode ovtm; >@@ -41,6 +44,7 @@ int main(int argc, char **argv) { > static struct option long_options[] = { /* For parsing long arguments */ > {"current", 0, &o_lock_all, 0}, > {"all", 0, &o_lock_all, 1}, >+ {"erase", no_argument, &o_erase_terminal, 1}, > {"version", no_argument, 0, O_VERSION}, > {"help", no_argument, 0, O_HELP}, > {0, 0, 0, 0}, >@@ -51,7 +55,7 @@ int main(int argc, char **argv) { > char *env; > > /* First we parse all the command line arguments */ >- while ((c = getopt_long(argc, argv, "acvh", >+ while ((c = getopt_long(argc, argv, "acevh", > long_options, &option_index)) != -1) { > switch(c) { > case 'c': >@@ -60,6 +64,9 @@ int main(int argc, char **argv) { > case 'a': > o_lock_all = 1; > break; >+ case 'e': >+ o_erase_terminal = 1; >+ break; > case 'v': > case O_VERSION: > fprintf(stderr, VERSION); >@@ -116,6 +123,12 @@ int main(int argc, char **argv) { > ioctl(vfd, VT_SETMODE, &vtm); > } > >+ /* Erase console. 2J erases display; 3J, since Linux 3.0, erases scroll-back >+ * buffer too. */ >+ if (o_erase_terminal) { >+ puts("\E[3J\E[2J"); >+ } >+ > /* get_password() sets the terminal characteristics and does not */ > /* return until the correct password has been read. */ > get_password(); >-- >1.7.7.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 807369
: 573106