From b44da223499ebc2b2088a1cef2d44b7ed1777529 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 21 Dec 2023 13:06:01 +0100 Subject: [PATCH] Fix tracefile setting, C type errors (#2255510) Related to: --- telnet-c99.patch | 38 ++++++++++++++++++++++++++++++++++++++ telnet.spec | 7 ++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 telnet-c99.patch diff --git a/telnet-c99.patch b/telnet-c99.patch new file mode 100644 index 0000000..07a2039 --- /dev/null +++ b/telnet-c99.patch @@ -0,0 +1,38 @@ +The changes to telnet/commands.c fix fix a crash in the tracefile +command on 64-bit architectures due to pointer truncation. + +The telnetd.c change is just to avoid a future compiler error. + +diff -ur netkit-telnet-0.17.orig/telnet/commands.c netkit-telnet-0.17/telnet/commands.c +--- netkit-telnet-0.17.orig/telnet/commands.c 2023-12-21 12:28:51.146313891 +0100 ++++ netkit-telnet-0.17/telnet/commands.c 2023-12-21 12:58:47.177886556 +0100 +@@ -843,7 +843,7 @@ + struct termios new_tc; + #endif + +-typedef void (*set_handler_t) P((int)); ++typedef void (*set_handler_t) P((char *)); + struct setlist { + const char *name; /* name */ + const char *help; /* help information */ +@@ -857,7 +857,7 @@ + #endif + { "escape", "character to escape back to telnet command mode", 0, &escape }, + { "rlogin", "rlogin escape character", 0, &rlogin }, +- { "tracefile", "file to write trace information to", (set_handler_t)SetNetTrace, (cc_t *)NetTraceFile}, ++ { "tracefile", "file to write trace information to", SetNetTrace, (cc_t *)NetTraceFile}, + { " ", "", 0, NULL }, + { " ", "The following need 'localchars' to be toggled true", 0, 0 }, + { "flushoutput", "character to cause an Abort Output", 0, &termFlushChar }, +diff -ur netkit-telnet-0.17.orig/telnetd/telnetd.c netkit-telnet-0.17/telnetd/telnetd.c +--- netkit-telnet-0.17.orig/telnetd/telnetd.c 2023-12-21 12:28:51.149313860 +0100 ++++ netkit-telnet-0.17/telnetd/telnetd.c 2023-12-21 12:29:51.396695540 +0100 +@@ -385,7 +385,7 @@ + } + #endif /* defined(HAS_IPPROTO_IP) && defined(IP_TOS) */ + net = s; +- doit(&from, fromlen); ++ doit((struct sockaddr *) &from, fromlen); + /* NOTREACHED */ + return 0; + } /* end of main */ diff --git a/telnet.spec b/telnet.spec index 6a93de3..9a2005d 100644 --- a/telnet.spec +++ b/telnet.spec @@ -3,7 +3,7 @@ Summary: The client program for the Telnet remote login protocol Name: telnet Version: 0.17 -Release: 90%{?dist} +Release: 91%{?dist} Epoch: 1 License: BSD-3-Clause AND BSD-4-Clause AND BSD-4-Clause-UC Source0: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-telnet-%{version}.tar.gz @@ -42,6 +42,7 @@ Patch31: netkit-telnet-0.17-telnetrc.patch Patch32: telnet-log-address.patch Patch33: telnet-0.17-overflow-exploit.patch Patch34: telnet-0.17-pty-retry.patch +Patch35: telnet-c99.patch BuildRequires: make BuildRequires: ncurses-devel systemd gcc gcc-c++ @@ -100,6 +101,7 @@ mv telnet telnet-NETKIT %patch32 -p1 -b .log-address %patch33 -p1 -b .overflow %patch34 -p1 -b .pty-retry +%patch35 -p1 -b .c99 %build %ifarch s390 s390x @@ -162,6 +164,9 @@ install -D -p -m644 %SOURCE6 ${RPM_BUILD_ROOT}%{_unitdir}/telnet.socket %{_mandir}/man8/telnetd.8* %changelog +* Thu Dec 21 2023 Florian Weimer - 1:0.17-91 +- Fix tracefile setting, C type errors (#2255510) + * Sat Jul 22 2023 Fedora Release Engineering - 1:0.17-90 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild