Compare commits

...

No commits in common. "c8" and "c9-beta" have entirely different histories.
c8 ... c9-beta

3 changed files with 68 additions and 70 deletions

View File

@ -128,58 +128,6 @@ index 1b8a881..b2f9059 100644
--
2.35.1
# Fix Calling "setsockopt" without checking return value. This library
# function may fail and return an error code.
diff --git a/tftpd/recvfrom.c b/tftpd/recvfrom.c
index d7ef500..e0074d8 100644
--- a/tftpd/recvfrom.c
+++ b/tftpd/recvfrom.c
@@ -26,6 +26,7 @@
#if defined(HAVE_RECVMSG) && defined(HAVE_MSGHDR_MSG_CONTROL)
+#include <syslog.h>
#include <sys/uio.h>
#ifdef IP_PKTINFO
@@ -151,16 +151,19 @@ myrecvfrom(int s, void *buf, int len, unsigned int flags,
/* Try to enable getting the return address */
#ifdef IP_RECVDSTADDR
if (from->sa_family == AF_INET || !from->sa_family)
- setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on));
+ if (setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on)) == -1)
+ syslog(LOG_ERR, "cannot setsockopt IP_RECVDSTADDR %m");
#endif
#ifdef IP_PKTINFO
if (from->sa_family == AF_INET || !from->sa_family)
- setsockopt(s, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on));
+ if (setsockopt(s, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on)) == -1)
+ syslog(LOG_ERR, "cannot setsockopt IP_PKTINFO %m");
#endif
#ifdef HAVE_IPV6
#ifdef IPV6_RECVPKTINFO
if (from->sa_family == AF_INET6 || !from->sa_family)
- setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on));
+ if (setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on)) == -1)
+ syslog(LOG_ERR, "cannot setsockopt IPV6_RECVPKTINFO %m");
#endif
#endif
bzero(&msg, sizeof msg); /* Clear possible system-dependent fields */
diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
index 364e7d2..36d6dec 100644
--- a/tftpd/tftpd.c
+++ b/tftpd/tftpd.c
@@ -224,7 +224,9 @@ static void pmtu_discovery_off(int fd)
#if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)
int pmtu = IP_PMTUDISC_DONT;
- setsockopt(fd, IPPROTO_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu));
+ if (setsockopt(fd, IPPROTO_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu)) == -1)
+ syslog(LOG_ERR, "cannot setsockopt IP_MTU_DISCOVER to "
+ "IP_PMTUDISC_DONT %m");
#endif
}
# Fixes negative_returns: "fd" is passed to a parameter of pmtu_discovery_off
# that cannot be negative
From 0b44159b3a2f51d350f309d3f6d14a17e74e8231 Mon Sep 17 00:00:00 2001

View File

@ -0,0 +1,12 @@
diff -up tftp-hpa-5.2/tftp/tftp.c.gcc10 tftp-hpa-5.2/tftp/tftp.c
--- tftp-hpa-5.2/tftp/tftp.c.gcc10 2020-05-04 00:56:28.787896509 +0200
+++ tftp-hpa-5.2/tftp/tftp.c 2020-05-04 00:58:42.502901005 +0200
@@ -48,7 +48,7 @@ extern int maxtimeout;
#define PKTSIZE SEGSIZE+4
char ackbuf[PKTSIZE];
int timeout;
-sigjmp_buf toplevel;
+extern sigjmp_buf toplevel;
sigjmp_buf timeoutbuf;
static void nak(int, const char *);

View File

@ -1,12 +1,10 @@
%global systemctl_bin /usr/bin/systemctl
%global _hardened_build 1
Summary: The client for the Trivial File Transfer Protocol (TFTP)
Name: tftp
Version: 5.2
Release: 26%{?dist}
Release: 38%{?dist}
License: BSD
Group: Applications/Internet
URL: http://www.kernel.org/pub/software/network/tftp/
Source0: http://www.kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-%{version}.tar.bz2
Source1: tftp.socket
@ -22,10 +20,15 @@ Patch7: tftp-hpa-0.49-stats.patch
Patch8: tftp-hpa-5.2-pktinfo.patch
Patch9: tftp-doc.patch
Patch10: tftp-enhanced-logging.patch
Patch11: tftp-rewrite-macro.patch
Patch12: tftp-hpa-5.2-covscan.patch
Patch11: tftp-hpa-5.2-gcc10.patch
Patch12: tftp-rewrite-macro.patch
Patch13: tftp-hpa-5.2-covscan.patch
BuildRequires: readline-devel autoconf systemd-units
BuildRequires: autoconf
BuildRequires: gcc
BuildRequires: make
BuildRequires: readline-devel
BuildRequires: systemd-rpm-macros
%description
The Trivial File Transfer Protocol (TFTP) is normally used only for
@ -35,7 +38,6 @@ remote machine. This program and TFTP provide very little security,
and should not be enabled unless it is expressly needed.
%package server
Group: System Environment/Daemons
Summary: The server for the Trivial File Transfer Protocol (TFTP)
Requires: systemd-units
Requires(post): systemd-units
@ -61,8 +63,9 @@ systemd socket activation, and is disabled by default.
%patch8 -p1 -b .pktinfo
%patch9 -p1 -b .doc
%patch10 -p1 -b .logging
%patch11 -p1 -b .rewrite-macro
%patch12 -p1 -b .covscan
%patch11 -p1 -b .gcc10
%patch12 -p1 -b .rewrite-macro
%patch13 -p1 -b .covscan
%build
autoreconf
@ -70,7 +73,6 @@ autoreconf
make %{?_smp_mflags}
%install
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man{1,8}
mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
@ -92,9 +94,6 @@ install -p -m 644 %SOURCE2 ${RPM_BUILD_ROOT}%{_unitdir}
%systemd_postun_with_restart tftp.socket
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%doc README README.security CHANGES
%{_bindir}/tftp
@ -108,13 +107,52 @@ rm -rf ${RPM_BUILD_ROOT}
%{_unitdir}/*
%changelog
* Tue Apr 26 2022 Lukáš Zaoral <lzaoral@redhat.com> - 5.2-26
- Review and fix issues reported by static analysers (rhbz#2078858)
* Thu Jan 04 2024 Lukáš Zaoral <lzaoral@redhat.com> - 5.2-38
- fix regression with too chatty syslog calls when IPv6 is disabled (RHEL-19588)
* Wed Apr 20 2022 Lukáš Zaoral <lzaoral@redhat.com> - 5.2-25
- Fix inconsistent --map-file option spelling in manual (rhbz#2066853)
* Wed Apr 06 2022 Lukáš Zaoral <lzaoral@redhat.com> - 5.2-37
- Review and fix issues reported by static analysers (rhbz#2069613)
- Use systemd-rpm-macros and modernise the specfile a bit
- Based on changes made by Dominik 'Rathann' Mierzejewski in Fedora.
Thanks a lot!
* Wed Mar 23 2022 Lukáš Zaoral <lzaoral@redhat.com> - 5.2-36
- Fix inconsistent --map-file option spelling in manual (rhbz#2066855)
- Fix memory corruption in tftpd when filename remapping with macro \x
is used (rhbz#2066862)
is used (rhbz#2066858)
* Thu Jan 27 2022 Lukáš Zaoral <lzaoral@redhat.com> - 5.2-35
- Rebuilt for fixed gating.yaml. Related rhbz#2042975
* Thu Jan 27 2022 Lukáš Zaoral <lzaoral@redhat.com> - 5.2-34
- Rebuilt for added gating.yaml. Related rhbz#2042975
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 5.2-33
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.2-32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.2-31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Sun May 03 2020 Dominik Mierzejewski <rpm@greysector.net> - 5.2-30
- fix build with gcc 10 (#1800195)
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.2-29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.2-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 5.2-27
- Rebuild for readline 8.0
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.2-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.2-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 5.2-24
- Escape macros in %%changelog