Hello community, here is the log from the commit of package telnet for openSUSE:Factory checked in at 2014-10-18 09:08:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/telnet (Old) and /work/SRC/openSUSE:Factory/.telnet.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "telnet" Changes: -------- --- /work/SRC/openSUSE:Factory/telnet/telnet.changes 2014-10-06 22:04:46.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.telnet.new/telnet.changes 2014-10-18 09:08:31.000000000 +0200 @@ -1,0 +2,6 @@ +Wed Oct 15 12:25:31 UTC 2014 - kstreitova@suse.com + +- added telnet-bsd-1.2-fix-infinite-loop.patch that fixes the + generating an infinite loop (bnc#898481) + +------------------------------------------------------------------- New: ---- telnet-bsd-1.2-fix-infinite-loop.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ telnet.spec ++++++ --- /var/tmp/diff_new_pack.glCznM/_old 2014-10-18 09:08:32.000000000 +0200 +++ /var/tmp/diff_new_pack.glCznM/_new 2014-10-18 09:08:32.000000000 +0200 @@ -31,6 +31,8 @@ Patch3: telnet-bsd-1.2-no_gethostbyname.patch #PATCH-FIX-UPSTREAM fix crash when using -b option bnc#700229 Patch4: telnet-bsd-1.2-hostalias.patch +#PATCH-FIX-UPSTREAM bnc#898481 kstreitova@suse.com -- fix the infinite loop consumes an entire CPU +Patch5: telnet-bsd-1.2-fix-infinite-loop.patch BuildRequires: ncurses-devel Requires: netcfg Provides: nkitb:%{_bindir}/telnet @@ -65,6 +67,7 @@ %patch2 %patch3 %patch4 -p1 +%patch5 -p1 %build export CFLAGS="%{optflags} -fpie $(ncurses5-config --cflags)" ++++++ telnet-bsd-1.2-fix-infinite-loop.patch ++++++ diff -urN telnet-bsd-1.2/telnet/commands.c telnet-bsd-1.2_patched/telnet/commands.c --- telnet-bsd-1.2/telnet/commands.c 2005-06-02 10:12:51.000000000 +0200 +++ telnet-bsd-1.2_patched/telnet/commands.c 2014-09-30 16:07:39.772644812 +0200 @@ -2534,8 +2534,7 @@ env_export ((unsigned char *) "USER"); } call (status, "status", "notmuch", 0); - if (sigsetjmp (peerdied, 1) == 0) - telnet (user); + telnet (user); NetClose (net); ExitString ("Connection closed by foreign host.\r\n", 1); /*NOTREACHED*/ return 0; diff -urN telnet-bsd-1.2/telnet/externs.h telnet-bsd-1.2_patched/telnet/externs.h --- telnet-bsd-1.2/telnet/externs.h 2005-06-01 13:42:23.000000000 +0200 +++ telnet-bsd-1.2_patched/telnet/externs.h 2014-09-30 16:09:03.141437234 +0200 @@ -174,7 +174,6 @@ SetNetTrace (char *); /* Function to change where debugging goes */ extern sigjmp_buf - peerdied, toplevel; /* For error conditions. */ /* authenc.c */ diff -urN telnet-bsd-1.2/telnet/network.c telnet-bsd-1.2_patched/telnet/network.c --- telnet-bsd-1.2/telnet/network.c 2004-02-13 22:52:24.000000000 +0100 +++ telnet-bsd-1.2_patched/telnet/network.c 2014-09-30 16:10:05.365071096 +0200 @@ -142,7 +142,7 @@ perror(hostname); (void)NetClose(net); ring_clear_mark(&netoring); - siglongjmp(peerdied, -1); + ExitString("Connection closed by foreign host.\n", 1); /*NOTREACHED*/ } n = 0; diff -urN telnet-bsd-1.2/telnet/sys_bsd.c telnet-bsd-1.2_patched/telnet/sys_bsd.c --- telnet-bsd-1.2/telnet/sys_bsd.c 2004-02-14 14:20:04.000000000 +0100 +++ telnet-bsd-1.2_patched/telnet/sys_bsd.c 2014-09-30 16:30:14.601380247 +0200 @@ -778,15 +778,6 @@ /* ARGSUSED */ static void -deadpeer (int sig) -{ - (void) sig; - setcommandmode (); - siglongjmp (peerdied, -1); -} - - /* ARGSUSED */ -static void intr (int sig) { (void) sig; @@ -856,7 +847,7 @@ { (void) signal (SIGINT, intr); (void) signal (SIGQUIT, intr2); - (void) signal (SIGPIPE, deadpeer); + (void) signal(SIGPIPE, SIG_IGN); #ifdef SIGWINCH (void) signal (SIGWINCH, sendwin); #endif diff -urN telnet-bsd-1.2/telnet/telnet.c telnet-bsd-1.2_patched/telnet/telnet.c --- telnet-bsd-1.2/telnet/telnet.c 2005-06-02 10:09:46.000000000 +0200 +++ telnet-bsd-1.2_patched/telnet/telnet.c 2014-09-30 16:13:57.158453184 +0200 @@ -107,7 +107,6 @@ static int telrcv_state; sigjmp_buf toplevel; -sigjmp_buf peerdied; int flushline; int linemode; diff -urN telnet-bsd-1.2/telnet/terminal.c telnet-bsd-1.2_patched/telnet/terminal.c --- telnet-bsd-1.2/telnet/terminal.c 2005-06-01 17:33:09.000000000 +0200 +++ telnet-bsd-1.2_patched/telnet/terminal.c 2014-09-30 16:17:52.934863547 +0200 @@ -88,7 +88,8 @@ /* - * Send as much data as possible to the terminal. + * Send as much data as possible to the terminal, else exits if + * it encounters a permanent failure when writing to the tty. * * Return value: * -1: No useful work done, data waiting to go out. @@ -130,8 +131,19 @@ } ring_consumed(&ttyoring, n); } - if (n < 0) - return -1; + if (n < 0) { + if (errno == EAGAIN || errno == EINTR) { + return -1; + } else { + ring_consumed(&ttyoring, ring_full_count(&ttyoring)); + setconnmode(0); + setcommandmode(); + NetClose(net); + fprintf(stderr, "Write error on local output.\n"); + exit(1); + } + return -1; + } if (n == n0) { if (n0) return -1; -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org