Compare commits
No commits in common. "c9" and "c8" have entirely different histories.
54
SOURCES/netkit-telnet-0.17-covscan.patch
Normal file
54
SOURCES/netkit-telnet-0.17-covscan.patch
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
--- a/telnet/commands.c.old
|
||||||
|
+++ b/telnet/commands.c
|
||||||
|
@@ -2181,12 +2181,13 @@ cmdrc(char *m1, char *m2)
|
||||||
|
int gotmachine = 0;
|
||||||
|
int l1 = strlen(m1);
|
||||||
|
int l2 = strlen(m2);
|
||||||
|
- char m1save[MAXHOSTNAMELEN];
|
||||||
|
+ char m1save[MAXHOSTNAMELEN+1];
|
||||||
|
|
||||||
|
if (skiprc)
|
||||||
|
return;
|
||||||
|
|
||||||
|
strncpy(m1save, m1, sizeof(m1save));
|
||||||
|
+ m1save[MAXHOSTNAMELEN] = 0;
|
||||||
|
m1 = m1save;
|
||||||
|
|
||||||
|
if (rcname[0] == 0) {
|
||||||
|
@@ -2218,11 +2218,11 @@ cmdrc(char *m1, char *m2)
|
||||||
|
if (isspace(line[0]))
|
||||||
|
continue;
|
||||||
|
if (strncasecmp(line, m1, l1) == 0)
|
||||||
|
- strncpy(line, &line[l1], sizeof(line) - l1);
|
||||||
|
+ memmove(line, &line[l1], sizeof(line) - l1);
|
||||||
|
else if (strncasecmp(line, m2, l2) == 0)
|
||||||
|
- strncpy(line, &line[l2], sizeof(line) - l2);
|
||||||
|
+ memmove(line, &line[l2], sizeof(line) - l2);
|
||||||
|
else if (strncasecmp(line, "DEFAULT", 7) == 0)
|
||||||
|
- strncpy(line, &line[7], sizeof(line) - 7);
|
||||||
|
+ memmove(line, &line[7], sizeof(line) - 7);
|
||||||
|
else
|
||||||
|
continue;
|
||||||
|
if (line[0] != ' ' && line[0] != '\t' && line[0] != '\n')
|
||||||
|
@@ -2345,6 +2345,7 @@ tn(int argc, char *argv[])
|
||||||
|
}
|
||||||
|
usage:
|
||||||
|
printf("usage: %s [-l user] [-a] host-name [port]\r\n", cmd);
|
||||||
|
+ free(user);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (hostp == 0)
|
||||||
|
--- a/telnetd/utility.c
|
||||||
|
+++ b/telnetd/utility.c
|
||||||
|
@@ -68,8 +68,10 @@ output_data(const char *format, ...)
|
||||||
|
char *buf;
|
||||||
|
|
||||||
|
va_start(args, format);
|
||||||
|
- if ((len = vasprintf(&buf, format, args)) == -1)
|
||||||
|
+ if ((len = vasprintf(&buf, format, args)) == -1) {
|
||||||
|
+ va_end(args);
|
||||||
|
return -1;
|
||||||
|
+ }
|
||||||
|
output_datalen(buf, len);
|
||||||
|
va_end(args);
|
||||||
|
free(buf);
|
@ -1,19 +0,0 @@
|
|||||||
diff --git a/telnet/commands.c b/telnet/commands.c
|
|
||||||
index 636fb5c..c0cc9b9 100644
|
|
||||||
--- a/telnet/commands.c
|
|
||||||
+++ b/telnet/commands.c
|
|
||||||
@@ -2217,11 +2217,11 @@ cmdrc(char *m1, char *m2)
|
|
||||||
if (isspace(line[0]))
|
|
||||||
continue;
|
|
||||||
if (strncasecmp(line, m1, l1) == 0)
|
|
||||||
- strncpy(line, &line[l1], sizeof(line) - l1);
|
|
||||||
+ memmove(line, &line[l1], sizeof(line) - l1);
|
|
||||||
else if (strncasecmp(line, m2, l2) == 0)
|
|
||||||
- strncpy(line, &line[l2], sizeof(line) - l2);
|
|
||||||
+ memmove(line, &line[l2], sizeof(line) - l2);
|
|
||||||
else if (strncasecmp(line, "DEFAULT", 7) == 0)
|
|
||||||
- strncpy(line, &line[7], sizeof(line) - 7);
|
|
||||||
+ memmove(line, &line[7], sizeof(line) - 7);
|
|
||||||
else
|
|
||||||
continue;
|
|
||||||
if (line[0] != ' ' && line[0] != '\t' && line[0] != '\n')
|
|
15
SOURCES/telnet-0.17-sigpipe-segfault.patch
Normal file
15
SOURCES/telnet-0.17-sigpipe-segfault.patch
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
diff --git a/telnet/sys_bsd.c.old b/telnet/sys_bsd.c
|
||||||
|
index 9e05171..39845ac 100644
|
||||||
|
--- a/telnet/sys_bsd.c.old
|
||||||
|
+++ b/telnet/sys_bsd.c
|
||||||
|
@@ -833,6 +833,10 @@ NetSetPgrp(int fd)
|
||||||
|
void
|
||||||
|
deadpeer(int sig)
|
||||||
|
{
|
||||||
|
+ if(sig == SIGPIPE) {
|
||||||
|
+ signal(SIGPIPE, SIG_DFL);
|
||||||
|
+ fprintf(stderr, "Broken pipe\n");
|
||||||
|
+ }
|
||||||
|
(void)sig;
|
||||||
|
setcommandmode();
|
||||||
|
siglongjmp(peerdied, -1);
|
@ -3,9 +3,10 @@
|
|||||||
Summary: The client program for the Telnet remote login protocol
|
Summary: The client program for the Telnet remote login protocol
|
||||||
Name: telnet
|
Name: telnet
|
||||||
Version: 0.17
|
Version: 0.17
|
||||||
Release: 85%{?dist}
|
Release: 76%{?dist}
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
License: BSD
|
License: BSD
|
||||||
|
Group: Applications/Internet
|
||||||
Source0: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-telnet-%{version}.tar.gz
|
Source0: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-telnet-%{version}.tar.gz
|
||||||
Url: http://web.archive.org/web/20070819111735/www.hcs.harvard.edu/~dholland/computers/old-netkit.html
|
Url: http://web.archive.org/web/20070819111735/www.hcs.harvard.edu/~dholland/computers/old-netkit.html
|
||||||
# telnet-client tarball is snapshot of the OpenBSD client telnet
|
# telnet-client tarball is snapshot of the OpenBSD client telnet
|
||||||
@ -38,13 +39,13 @@ Patch27: telnet-0.17-force-ipv6-ipv4.patch
|
|||||||
Patch28: netkit-telnet-0.17-core-dump.patch
|
Patch28: netkit-telnet-0.17-core-dump.patch
|
||||||
Patch29: netkit-telnet-0.17-gcc7.patch
|
Patch29: netkit-telnet-0.17-gcc7.patch
|
||||||
Patch30: netkit-telnet-0.17-manpage.patch
|
Patch30: netkit-telnet-0.17-manpage.patch
|
||||||
Patch31: netkit-telnet-0.17-telnetrc.patch
|
Patch31: netkit-telnet-0.17-covscan.patch
|
||||||
Patch32: telnet-log-address.patch
|
Patch32: telnet-log-address.patch
|
||||||
Patch33: telnet-0.17-overflow-exploit.patch
|
Patch33: telnet-0.17-overflow-exploit.patch
|
||||||
Patch34: telnet-0.17-pty-retry.patch
|
Patch34: telnet-0.17-pty-retry.patch
|
||||||
|
Patch35: telnet-0.17-sigpipe-segfault.patch
|
||||||
|
|
||||||
BuildRequires: make
|
BuildRequires: ncurses-devel systemd
|
||||||
BuildRequires: ncurses-devel systemd gcc gcc-c++
|
|
||||||
BuildRequires: perl-interpreter
|
BuildRequires: perl-interpreter
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -56,6 +57,7 @@ Requires: systemd
|
|||||||
Requires(post): systemd
|
Requires(post): systemd
|
||||||
Requires(preun): systemd
|
Requires(preun): systemd
|
||||||
Requires(postun): systemd
|
Requires(postun): systemd
|
||||||
|
Group: System Environment/Daemons
|
||||||
Summary: The server program for the Telnet remote login protocol
|
Summary: The server program for the Telnet remote login protocol
|
||||||
|
|
||||||
%description server
|
%description server
|
||||||
@ -96,10 +98,11 @@ mv telnet telnet-NETKIT
|
|||||||
%patch28 -p1 -b .core-dump
|
%patch28 -p1 -b .core-dump
|
||||||
%patch29 -p1 -b .gcc7
|
%patch29 -p1 -b .gcc7
|
||||||
%patch30 -p1 -b .manpage
|
%patch30 -p1 -b .manpage
|
||||||
%patch31 -p1 -b .telnetrc
|
%patch31 -p1 -b .covscan
|
||||||
%patch32 -p1 -b .log-address
|
%patch32 -p1 -b .log-address
|
||||||
%patch33 -p1 -b .overflow
|
%patch33 -p1 -b .overflow
|
||||||
%patch34 -p1 -b .pty-retry
|
%patch34 -p1 -b .pty-retry
|
||||||
|
%patch35 -p1 -b .sigpipe
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%ifarch s390 s390x
|
%ifarch s390 s390x
|
||||||
@ -108,9 +111,9 @@ mv telnet telnet-NETKIT
|
|||||||
export CC_FLAGS="$RPM_OPT_FLAGS -fpie"
|
export CC_FLAGS="$RPM_OPT_FLAGS -fpie"
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
export LD_FLAGS="$RPM_LD_FLAGS -z now -pie"
|
export LD_FLAGS="$LD_FLAGS -z now -pie"
|
||||||
|
|
||||||
sh configure --with-c-compiler=%{__cc}
|
sh configure --with-c-compiler=gcc
|
||||||
perl -pi -e '
|
perl -pi -e '
|
||||||
s,-O2,\$(CC_FLAGS),;
|
s,-O2,\$(CC_FLAGS),;
|
||||||
s,LDFLAGS=.*,LDFLAGS=\$(LD_FLAGS),;
|
s,LDFLAGS=.*,LDFLAGS=\$(LD_FLAGS),;
|
||||||
@ -126,19 +129,20 @@ perl -pi -e 's|install[ ]+-s|install|g' \
|
|||||||
./telnetlogin/Makefile \
|
./telnetlogin/Makefile \
|
||||||
./telnet-NETKIT/Makefile
|
./telnet-NETKIT/Makefile
|
||||||
|
|
||||||
%{make_build}
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
|
mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
|
||||||
mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
|
mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
|
||||||
|
mkdir -p ${RPM_BUILD_ROOT}%{_unitdir}
|
||||||
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1
|
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1
|
||||||
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man5
|
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man5
|
||||||
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8
|
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8
|
||||||
|
|
||||||
make INSTALLROOT=${RPM_BUILD_ROOT} install
|
make INSTALLROOT=${RPM_BUILD_ROOT} install
|
||||||
|
|
||||||
install -D -p -m644 %SOURCE5 ${RPM_BUILD_ROOT}%{_unitdir}/telnet@.service
|
install -p -m644 %SOURCE5 ${RPM_BUILD_ROOT}%{_unitdir}/telnet@.service
|
||||||
install -D -p -m644 %SOURCE6 ${RPM_BUILD_ROOT}%{_unitdir}/telnet.socket
|
install -p -m644 %SOURCE6 ${RPM_BUILD_ROOT}%{_unitdir}/telnet.socket
|
||||||
|
|
||||||
%post server
|
%post server
|
||||||
%systemd_post telnet.socket
|
%systemd_post telnet.socket
|
||||||
@ -151,10 +155,12 @@ install -D -p -m644 %SOURCE6 ${RPM_BUILD_ROOT}%{_unitdir}/telnet.socket
|
|||||||
|
|
||||||
%files
|
%files
|
||||||
%doc README
|
%doc README
|
||||||
|
%defattr(-,root,root,-)
|
||||||
%{_bindir}/telnet
|
%{_bindir}/telnet
|
||||||
%{_mandir}/man1/telnet.1*
|
%{_mandir}/man1/telnet.1*
|
||||||
|
|
||||||
%files server
|
%files server
|
||||||
|
%defattr(-,root,root,-)
|
||||||
%{_unitdir}/*
|
%{_unitdir}/*
|
||||||
%{_sbindir}/in.telnetd
|
%{_sbindir}/in.telnetd
|
||||||
%{_mandir}/man5/issue.net.5*
|
%{_mandir}/man5/issue.net.5*
|
||||||
@ -162,48 +168,18 @@ install -D -p -m644 %SOURCE6 ${RPM_BUILD_ROOT}%{_unitdir}/telnet.socket
|
|||||||
%{_mandir}/man8/telnetd.8*
|
%{_mandir}/man8/telnetd.8*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1:0.17-85
|
* Tue Dec 15 2020 Michal Ruprich <mruprich@redhat.com> - 1:0.17-76
|
||||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
- Resolves: #1895387 - telnet crashes on stack overflow due to infinite recursion
|
||||||
Related: rhbz#1991688
|
|
||||||
|
|
||||||
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1:0.17-84
|
* Tue Oct 27 2020 Michal Ruprich <mruprich@redhat.com> - 1:0.17-75
|
||||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
- Resolves: #1881335 - in.telnetd needs to tolerate temporary EIO errors
|
||||||
|
|
||||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.17-83
|
* Thu Mar 26 2020 Michal Ruprich <michalruprich@gmail.com> - 1:0.17-74
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
- Resolves: #1814474 - Arbitrary remote code execution in utility.c via short writes or urgent data
|
||||||
|
|
||||||
* Thu Nov 19 2020 Michal Ruprich <mruprich@redhat.com> - 1:0.17-82
|
* Thu Oct 04 2018 Michal Ruprich <mruprich@redhat.com> - 1:0.17-73
|
||||||
- Changing LD_FLAGS to RPM_LD_FLAGS
|
- Resolves: #1602711 - Please review important issues found by covscan
|
||||||
- Use make_build macro and remove hard-coded gcc
|
- Resolves: #1637085 - Option -i is missing in telnet in el8 but is available in el7
|
||||||
- https://docs.fedoraproject.org/en-US/packaging-guidelines/#_parallel_make
|
|
||||||
|
|
||||||
* Fri Sep 25 2020 Michal Ruprich <mruprich@redhat.com> - 1:0.17-81
|
|
||||||
- Resolves: #1882606 - in.telnetd needs to tolerate temporary EIO errors
|
|
||||||
|
|
||||||
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.17-80
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
|
||||||
|
|
||||||
* Fri Mar 27 2020 Michal Ruprich <mruprich@redhat.com> - 1:0.17-79
|
|
||||||
- Resolves: #1814478 - Arbitrary remote code execution in utility.c via short writes or urgent data
|
|
||||||
|
|
||||||
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.17-78
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
|
||||||
|
|
||||||
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.17-77
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
|
||||||
|
|
||||||
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.17-76
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
|
||||||
|
|
||||||
* Wed Oct 10 2018 Michal Ruprich <mruprich@redhat.com> - 1:0.17-75
|
|
||||||
- Adding -i option for disabling reverse DNS lookup
|
|
||||||
|
|
||||||
* Mon Jul 23 2018 Michal Ruprich <mruprich@redhat.com> - 1:0.17-74
|
|
||||||
- Resolves: #1606506 - telnet: FTBFS in Fedora rawhide
|
|
||||||
- Resolves: #1505954 - telnet failing to parse .telnetrc due to strncpy used on overlaping buffers
|
|
||||||
|
|
||||||
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.17-73
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
|
||||||
|
|
||||||
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.17-72
|
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.17-72
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||||
|
Loading…
Reference in New Issue
Block a user