Fix socket length incompatibility (C compatibility issue)

This commit is contained in:
Florian Weimer 2023-12-18 22:22:00 +01:00
parent 3862958686
commit c23247c9c7
2 changed files with 32 additions and 1 deletions

26
lrzsz-socklen.patch Normal file
View File

@ -0,0 +1,26 @@
Use socklen_t as the length of the socket address (which is a bit of
an anachronism, considering the rest of the sources). The previous
code des not work on 64-bit big-endian architectures.
diff --git a/src/tcp.c b/src/tcp.c
index 137f94c37503abe9..69da8c9f8dff304b 100644
--- a/src/tcp.c
+++ b/src/tcp.c
@@ -56,7 +56,7 @@ tcp_server (char *buf)
struct sockaddr_in s;
struct sockaddr_in t;
int on=1;
- size_t len;
+ socklen_t len;
if ((sock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
error(1,errno,"socket");
@@ -91,7 +91,7 @@ tcp_accept (int d)
{
int so;
struct sockaddr_in s;
- size_t namelen;
+ socklen_t namelen;
int num=0;
namelen = sizeof(s);

View File

@ -1,7 +1,7 @@
Summary: The lrz and lsz modem communications programs
Name: lrzsz
Version: 0.12.20
Release: 61%{?dist}
Release: 62%{?dist}
License: GPL-2.0-or-later AND GPL-2.0-only
Source: http://www.ohse.de/uwe/releases/%{name}-%{version}.tar.gz
Patch1: lrzsz-0.12.20-glibc21.patch
@ -10,6 +10,7 @@ Patch3: lrzsz-0.12.20-man.patch
Patch4: lrzsz-0.12.20-aarch64.patch
Patch5: lrzsz-configure-c99.patch
Patch6: lrzsz-c99.patch
Patch7: lrzsz-socklen.patch
Url: http://www.ohse.de/uwe/software/lrzsz.html
BuildRequires: gcc gettext
BuildRequires: make
@ -29,6 +30,7 @@ copylefted Zmodem solution for Linux systems.
%patch4 -p1 -b .aarch64
%patch5 -p1
%patch6 -p1
%patch7 -p1
rm -f po/*.gmo
@ -53,6 +55,9 @@ for m in sb sx; do ln -s sz.1 %{buildroot}%{_mandir}/man1/$m.1; done
%{_mandir}/*/*
%changelog
* Mon Dec 18 2023 Florian Weimer <fweimer@redhat.com> - 0.12.20-62
- Fix socket length incompatibility (C compatibility issue)
* Tue Oct 31 2023 Tomas Korbar <tkorbar@redhat.com> - 0.12.20-61
- Add additional SPDX licenses found by scancode tool