The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/982

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Let's be on the safe side an mimic ssh.

Signed-off-by: Christian Brauner <[email protected]>
From a7c97a40ec3939047157633b23e6015c0d5c78ce Mon Sep 17 00:00:00 2001
From: Christian Brauner <[email protected]>
Date: Tue, 19 Apr 2016 15:17:19 +0200
Subject: [PATCH] use raw settings of ssh for pty

Signed-off-by: Christian Brauner <[email protected]>
---
 src/lxc/console.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/lxc/console.c b/src/lxc/console.c
index c6f6adc..6d335ca 100644
--- a/src/lxc/console.c
+++ b/src/lxc/console.c
@@ -260,16 +260,21 @@ int lxc_setup_tios(int fd, struct termios *oldtios)
 
        newtios = *oldtios;
 
-       /* Remove the echo characters and signal reception, the echo
-        * will be done with master proxying */
-       newtios.c_iflag &= ~(IGNBRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON|IXANY|IXOFF);
-       newtios.c_iflag &= BRKINT;
-       newtios.c_lflag &= ~(ECHO|ICANON|ISIG|IEXTEN|ECHOE|ECHOK|ECHONL);
+       /* We use the same settings that ssh does. */
+       newtios.c_iflag |= IGNPAR;
+       newtios.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | 
IXOFF);
+#ifdef IUCLC
+       newtios.c_iflag &= ~IUCLC;
+#endif
+       newtios.c_lflag &= ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL);
+#ifdef IEXTEN
+       newtios.c_lflag &= ~IEXTEN;
+#endif
        newtios.c_oflag &= ~OPOST;
        newtios.c_cc[VMIN] = 1;
        newtios.c_cc[VTIME] = 0;
 
-       /* Set new attributes */
+       /* Set new attributes. */
        if (tcsetattr(fd, TCSAFLUSH, &newtios)) {
                ERROR("failed to set new terminal settings");
                return -1;
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to