# # spec file for package telnet # # Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: telnet Version: 1.2 Release: 176.2 Summary: A client program for the telnet remote login protocol License: BSD-3-Clause Group: Productivity/Networking/Other URL: https://svnweb.freebsd.org/base/head/contrib/telnet/ Source: http://distfiles.gentoo.org/distfiles/f3/telnet-bsd-%{version}.tar.bz2 Source3: telnet.socket Source4: telnet@.service Source5: telnet.target Patch1: telnet-bsd-1.2-suppress_hostname.patch Patch2: telnet-bsd-1.2-man-page.patch 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 # PATCH-FIX-SECURITY bsc#1203759 danilo.spinella@suse.com CVE-2022-39028 # NULL pointer dereference in telnetd Patch6: CVE-2022-39028.patch BuildRequires: ncurses-devel BuildRequires: systemd-rpm-macros Provides: nkitb:%{_bindir}/telnet %description Telnet is an old protocol for logging into remote systems. It is rarely used, since the transfer is not encrypted (ssh is mostly used these days). The telnet client is often used for debugging other network services. The command telnet localhost 25 connects to the local smtp server, for example. %package server Summary: A Server Program for the Telnet Remote Login Protocol Group: Productivity/Networking/Other Requires: netcfg libnss_usrfiles2 Provides: nkitserv:%{_sbindir}/in.telnetd Obsoletes: nkitserv %{?systemd_requires} %description server Telnet is a popular protocol for logging into remote systems. This package provides the telnet daemon, which will allow remote logins into this machine. %prep %setup -q -n telnet-bsd-%{version} %patch1 %patch2 %patch3 %patch4 -p1 %patch5 -p1 %patch6 -p1 %build export CFLAGS="%{optflags} -fpie $(ncurses6-config --cflags)" export LDFLAGS="-pie $(ncurses6-config --libs)" %configure %make_build %install install -d -m 755 %{buildroot}%{_bindir} install -d -m 755 %{buildroot}%{_sbindir} install -d -m 755 %{buildroot}%{_mandir}/man1 install -d -m 755 %{buildroot}%{_mandir}/man5 install -d -m 755 %{buildroot}%{_mandir}/man8 %make_install install -D -m 644 %{SOURCE3} %{buildroot}/%{_unitdir}/telnet.socket install -D -m 644 %{SOURCE4} %{buildroot}/%{_unitdir}/telnet@.service install -D -m 644 %{SOURCE5} %{buildroot}/%{_unitdir}/telnet.target %files %defattr(644,root,root,755) %license COPYING %doc ChangeLog README NEWS %attr(755,root,root) %{_bindir}/telnet %{_mandir}/man1/telnet.1%{?ext_man} %files server %defattr(644,root,root,755) %license COPYING %doc ChangeLog README NEWS %{_mandir}/man8/in.telnetd.8%{?ext_man} %{_mandir}/man8/telnetd.8%{?ext_man} %{_mandir}/man5/issue.net.5%{?ext_man} %attr(755,root,root) %{_sbindir}/in.telnetd %{_unitdir}/telnet@.service %{_unitdir}/telnet.socket %{_unitdir}/telnet.target %pre server %service_add_pre telnet.socket %post server %service_add_post telnet.socket %preun server %service_del_preun telnet.target %postun server %service_del_postun telnet.target %changelog * Fri Oct 21 2022 Danilo Spinella - Fix CVE-2022-39028, NULL pointer dereference in telnetd (CVE-2022-39028, bsc#1203759) CVE-2022-39028.patch * Wed Dec 15 2021 Danilo Spinella - Update Source location to use Gentoo mirror, fixes bsc#1129925 - Run spec-cleaner * Thu Oct 31 2019 Fabian Vogt - Move netcfg and systemd requires to -server subpackage * Fri Jul 26 2019 matthias.gerstner@suse.com - removal of SuSEfirewall2 service, since SuSEfirewall2 has been replaced by firewalld, see [1]. [1]: https://lists.opensuse.org/opensuse-factory/2019-01/msg00490.html * Tue May 29 2018 kstreitova@suse.com - add telnet.target that incorporates telnet.socket and telnet@.service. Adjust systemd service_* macros parameters and use this target instead of telnet@.service for stop/restart cases where telnet@.service cannot be used but telnet.target can [bsc#1093174] * Fri Jun 16 2017 aliouliaki@suse.com - Removed xinetd service - Added telnet@.service and telnet.socket - Cleanup of telnet.spec * Thu Feb 2 2017 dimstar@opensuse.org - Switch to ncurses6: use ncurses6-config to find the correct CFLAGS and libraries. * Wed Oct 15 2014 kstreitova@suse.com - added telnet-bsd-1.2-fix-infinite-loop.patch that fixes the generating an infinite loop (bnc#898481) * Mon Oct 6 2014 kstreitova@suse.com - url was repaired * Fri Oct 3 2014 kstreitova@suse.com - spec-cleaner used for cleaning the specfile up - "export NO_BRP_STRIP_DEBUG=true" removed from specfile * Fri Apr 5 2013 idonmez@suse.com - Add Source URL, see https://en.opensuse.org/SourceUrls * Mon Jan 2 2012 andreas.stieger@gmx.de - removed telnet-bsd-1.2-tinfo.patch Replacing -lncurses with -ltinfo doesn't seem to be required and it actually breaks builds - refresh telnet-bsd-1.2-suppress_hostname.patch - remove makros from patch names - use makros for configure, make and make install * Thu Nov 24 2011 vcizek@suse.com - added -ltinfo instead of -lncurses * Thu Jun 30 2011 vcizek@novell.com - exit cleanly, when hostalias cannot be resolved (bnc#700229) - made manpage more clear about the -b option * Wed Sep 30 2009 crrodriguez@opensuse.org - telnet-server does require xinetd * Fri May 22 2009 crrodriguez@suse.de - do not use gethostbyname(3) but getaddrinfo(3) patch by Ulrich Drepper. * Sat Aug 30 2008 cthiel@suse.de - fix build with latests ncurses * Wed Apr 9 2008 jsrain@suse.cz - fixed description for ports information for SuSEfirewall (bnc #373969) * Mon Jan 7 2008 mskibbe@suse.de - Bug 351197 - several packages use wrong dir for SuSEfirewall2 services files * Thu Mar 29 2007 dmueller@suse.de - add ncurses-devel BuildRequires * Fri Mar 2 2007 mskibbe@suse.de - telnet-server : Support for FATE #300687: Ports for SuSEfirewall added via packages (#250570) * Mon Dec 4 2006 mskibbe@suse.de - fix Bug #224847(telnet man page does not mention DEFAULT for .telnetrc) * Fri May 19 2006 kssingvo@suse.de - added option -H to suppress hostname (bugzilla#175376) * Wed Jan 25 2006 mls@suse.de - converted neededforbuild to BuildRequires * Thu Jun 16 2005 mmj@suse.de - Compile with -fpie, link with -pie * Thu Jun 2 2005 kukuk@suse.de - Update to version 1.2 (-fpie/-pie support, latest security fixes) * Tue Apr 5 2005 mmj@suse.de - execl(..., 0) -> execl(..., NULL) * Fri Jun 11 2004 mmj@suse.de - Apply patch to avoid deadlock [#41864] * Wed Feb 25 2004 schwab@suse.de - Make sure _POSIX_VDISABLE is properly defined. * Sat Feb 14 2004 kukuk@suse.de - Update to telnet-bsd 1.1: - Fix -L option - Fix missing prototypes - Merge all patches * Thu Oct 16 2003 mmj@suse.de - Don't build as root * Tue May 13 2003 mmj@suse.de - Use %%defattr * Fri Mar 7 2003 ro@suse.de - remove empty server_args line in xinetd config file * Fri Jan 24 2003 mmj@suse.de - Dont use permission 755 for the xinetd file * Fri Jan 24 2003 mmj@suse.de - Add xinetd configuration file * Wed Dec 4 2002 mmj@suse.de - Fix one version of strcpy, gotten from the OpenBSD tree * Wed Feb 13 2002 mmj@suse.de - Increased the temporary buffer size in telnet to fix problem with long hostnames when telnetting to a Solaris box. * Tue Aug 14 2001 kukuk@suse.de - Add more fixes for possible security problems * Fri Jul 27 2001 kukuk@suse.de - Add fix for possible problems with buffer overruns * Mon Apr 2 2001 kukuk@suse.de - Add Obsolete for nkitserv * Thu Mar 22 2001 ro@suse.de - added split-aliases as provides * Tue Mar 13 2001 kukuk@suse.de - Initial package, split from nkitb