summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-05-27 09:34:56 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-05-27 09:34:56 +0000
commita7c474d1b0c7225dcba5c8445629b1e97cfc82fd (patch)
treeea63389bac41abab9d57ef725b7285dc62f834af /libexec
parent322b0aeefdf01931f75da5c48cfe289b97814ab8 (diff)
Stop echoing ANSI sequences back to the console, by expanding ESC character
to literal ^[. This makes getty interaction appear more like login, and stops a mid-ANSI sequence parsing problem that messed up login, making it freeze the session until timeout. ok tedu fcambus
Diffstat (limited to 'libexec')
-rw-r--r--libexec/getty/main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libexec/getty/main.c b/libexec/getty/main.c
index c96eebf9a02..e8f2e93ac4d 100644
--- a/libexec/getty/main.c
+++ b/libexec/getty/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.45 2017/05/27 09:31:13 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.46 2017/05/27 09:34:55 deraadt Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -392,7 +392,11 @@ getname(void)
if (IG && (c <= ' ' || c > 0176))
continue;
*np++ = c;
- putchr(cs);
+ if (c == '\033') {
+ putchr('^');
+ putchr('[');
+ } else
+ putchr(cs);
}
signal(SIGINT, SIG_IGN);
if (interrupt_flag) {