From eab4c80347ea5703c2945c19f15944e5af2cd0b6 Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Jul 13 2011 10:53:06 +0000 Subject: - add "-debug6" option to telnetd (#rh674942) - telnet wasn't interruptable (^C) when started with specious -b argument (#704604) Signed-off-by: Adam Tkac --- diff --git a/telnet-rh674942.patch b/telnet-rh674942.patch new file mode 100644 index 0000000..f06d99d --- /dev/null +++ b/telnet-rh674942.patch @@ -0,0 +1,47 @@ +--- netkit-telnet-0.17/telnetd/telnetd.c.orig 2011-01-31 12:05:37.942942871 -0600 ++++ netkit-telnet-0.17/telnetd/telnetd.c 2011-01-31 18:20:22.400743499 -0600 +@@ -82,6 +82,7 @@ char ptyibuf2[BUFSIZ]; + int hostinfo = 1; /* do we print login banner? */ + + int debug = 0; ++int debugsix = 0; + int keepalive = 1; + char *loginprg = _PATH_LOGIN; + char *progname; +@@ -150,8 +151,11 @@ main(int argc, char *argv[], char *env[] + #endif /* BFTPDAEMON */ + + case 'd': +- if (strcmp(optarg, "ebug") == 0) { ++ if (strncmp(optarg, "ebug", 4) == 0) { + debug++; ++ if (strncmp(optarg, "ebug6", 5) == 0) { ++ debugsix++; ++ } + break; + } + usage(); +@@ -271,6 +275,8 @@ main(int argc, char *argv[], char *env[] + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_ADDRCONFIG | AI_PASSIVE; + hints.ai_protocol = IPPROTO_TCP; ++ if (debugsix) ++ hints.ai_family = AF_INET6; + + if (argc == 0) { + if (getaddrinfo(NULL, "telnet", &hints, &ai) != 0) { +@@ -380,12 +386,12 @@ usage(void) + { + fprintf(stderr, "Usage: telnetd"); + #ifdef AUTHENTICATE +- fprintf(stderr, " [-a (debug|other|user|valid|off)]\n\t"); ++ fprintf(stderr, " [-a (debug|debug6|other|user|valid|off)]\n\t"); + #endif + #ifdef BFTPDAEMON + fprintf(stderr, " [-B]"); + #endif +- fprintf(stderr, " [-debug]"); ++ fprintf(stderr, " [-debug|-debug6]"); + #ifdef DIAGNOSTICS + fprintf(stderr, " [-D (options|report|exercise|netdata|ptydata)]\n\t"); + #endif diff --git a/telnet-rh704604.patch b/telnet-rh704604.patch new file mode 100644 index 0000000..9c040ba --- /dev/null +++ b/telnet-rh704604.patch @@ -0,0 +1,24 @@ +--- netkit-telnet-0.17/telnet/commands.c.hostalias 2011-07-11 08:07:22.000000000 -0400 ++++ netkit-telnet-0.17/telnet/commands.c 2011-07-11 08:10:12.131039660 -0400 +@@ -2400,17 +2400,21 @@ + ahints.ai_family = PF_UNSPEC; + ahints.ai_socktype = SOCK_STREAM; + ahints.ai_flags = AI_PASSIVE; + error = getaddrinfo(aliasp, "0", &ahints, &ares); + if (error) { ++ printf ("Couldn't get address for %s\n", aliasp); + warn("%s: %s", aliasp, gai_strerror(error)); + close(net); ++ net = -1; + continue; + } + if (bind(net, ares->ai_addr, ares->ai_addrlen) < 0) { ++ printf ("Couldn't bind to %s\n", aliasp); + perror(aliasp); + (void) close(net); /* dump descriptor */ ++ net = -1; + freeaddrinfo(ares); + continue; + } + freeaddrinfo(ares); + } diff --git a/telnet.spec b/telnet.spec index 6b28701..51bf3ac 100644 --- a/telnet.spec +++ b/telnet.spec @@ -1,7 +1,7 @@ Summary: The client program for the Telnet remote login protocol Name: telnet Version: 0.17 -Release: 50%{?dist} +Release: 51%{?dist} Epoch: 1 License: BSD Group: Applications/Internet @@ -28,6 +28,8 @@ Patch20: netkit-telnet-0.17-nodns.patch Patch21: telnet-0.17-errno_test_sys_bsd.patch Patch22: netkit-telnet-0.17-reallynodns.patch Patch23: telnet-rh678324.patch +Patch24: telnet-rh674942.patch +Patch25: telnet-rh704604.patch BuildRequires: ncurses-devel Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -72,6 +74,8 @@ mv telnet telnet-NETKIT %patch21 -p1 -b .errnosysbsd %patch22 -p1 -b .reallynodns %patch23 -p1 -b .rh678324 +%patch24 -p1 -b .rh674942 +%patch25 -p1 -b .rh704604 %build %ifarch s390 s390x @@ -131,6 +135,10 @@ rm -rf ${RPM_BUILD_ROOT} %{_mandir}/man8/telnetd.8* %changelog +* Wed Jul 13 2011 Adam Tkac 1:0.17-51 +- add "-debug6" option to telnetd (#rh674942) +- telnet wasn't interruptable (^C) when started with specious -b argument (#704604) + * Tue Jun 28 2011 Adam Tkac 1:0.17-50 - telnetd: store "from" address in sockaddr_storage (#678324)