[Pkg-vsquare-devel] Bug#682759: vde2: vdeterm does not restore terminal when it returns early in error

Serge Hallyn serge.hallyn at ubuntu.com
Wed Jul 25 11:47:28 UTC 2012


Package: vde2
Version: 2.3.2-4
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu quantal ubuntu-patch

Dear Maintainer,

vdeterm has a bug which leaves the terminal in a bad state if it exits
too early in error - in particular if it was unable to open its socket.
Simply typing

vdeterm

is sufficient to reproduce (and then verifying by typing into the 
terminal and seeing no echo).

I've also posted this bug upstream at:

http://sourceforge.net/tracker/?func=detail&aid=3548041&group_id=95403&atid=611248

In Ubuntu, the attached patch was applied to achieve the following:

  * vdeterm: don't improperly reset the terminal when exiting too
    early (LP: #804647)


Thanks for considering the patch.

diff -u vde2-2.3.2/debian/changelog vde2-2.3.2/debian/changelog
diff -u vde2-2.3.2/debian/patches/series vde2-2.3.2/debian/patches/series
--- vde2-2.3.2/debian/patches/series
+++ vde2-2.3.2/debian/patches/series
@@ -4,0 +5 @@
+vdeterm-terminal-reset
only in patch2:
unchanged:
--- vde2-2.3.2.orig/debian/patches/vdeterm-terminal-reset
+++ vde2-2.3.2/debian/patches/vdeterm-terminal-reset
@@ -0,0 +1,31 @@
+Description: don't reset terminal too early
+Author: Serge Hallyn <serge.hallyn at ubuntu.com>
+Forwarded: yes
+
+Index: vde2-2.3.2/src/vdeterm.c
+===================================================================
+--- vde2-2.3.2.orig/src/vdeterm.c	2011-11-23 10:41:18.000000000 -0600
++++ vde2-2.3.2/src/vdeterm.c	2012-07-24 17:25:52.293126588 -0500
+@@ -20,11 +20,13 @@
+ 
+ char *prompt;
+ static struct termios tiop;
++int termset = 0;
+ 
+ static void cleanup(void)
+ {
+ 	fprintf(stderr,"\n");
+-	tcsetattr(STDIN_FILENO,TCSAFLUSH,&tiop);
++	if (termset)
++		tcsetattr(STDIN_FILENO,TCSAFLUSH,&tiop);
+ }
+ 
+ static void sig_handler(int sig)
+@@ -135,6 +137,7 @@
+ 	newtiop.c_lflag &= ~ICANON;
+ 	newtiop.c_lflag &= ~ECHO;
+ 	tcsetattr(STDIN_FILENO,TCSAFLUSH,&newtiop);
++	termset = 1;
+ 	flags = fcntl(fd, F_GETFL);
+ 	flags |= O_NONBLOCK;
+ 	fcntl(fd, F_SETFL, flags);



More information about the Pkg-vsquare-devel mailing list