Resolves: #1445259 - telnet won't build with latest gcc

added note about address resolution in manpage
This commit is contained in:
Michal Ruprich 2017-04-25 14:27:04 +02:00
parent e861fd5ce4
commit 71aa42f7b1
3 changed files with 145 additions and 1 deletions

View File

@ -0,0 +1,121 @@
diff --git a/telnet/utilities.c b/telnet/utilities.c
index 0bb0eab..d89ca37 100644
--- a/telnet/utilities.c
+++ b/telnet/utilities.c
@@ -748,6 +748,7 @@ printsub(char direction, unsigned char *pointer, int length)
env_common:
{
register int noquote = 2;
+ char* msg;
#if defined(ENV_HACK) && defined(OLD_ENVIRON)
extern int old_env_var, old_env_value;
#endif
@@ -758,14 +759,24 @@ printsub(char direction, unsigned char *pointer, int length)
/* case NEW_ENV_OVAR: */
if (pointer[0] == TELOPT_OLD_ENVIRON) {
# ifdef ENV_HACK
- if (old_env_var == OLD_ENV_VALUE)
- fprintf(NetTrace, "\" (VALUE) " + noquote);
- else
+ if (old_env_var == OLD_ENV_VALUE) {
+ msg = "\" (VALUE) ";
+ fprintf(NetTrace, "%s", msg + noquote);
+ }
+ else {
# endif
- fprintf(NetTrace, "\" VAR " + noquote);
+ msg = "\" VAR ";
+ fprintf(NetTrace, "%s", msg + noquote);
+# ifdef ENV_HACK
+ }
+#endif /*ENV_HACK*/
} else
#endif /* OLD_ENVIRON */
- fprintf(NetTrace, "\" VALUE " + noquote);
+ msg = "\" VALUE ";
+ fprintf(NetTrace, "%s", msg + noquote);
+#ifdef OLD_ENVIRON
+ }
+#endif /* OLD_ENVIRON */
noquote = 2;
break;
@@ -774,24 +785,36 @@ printsub(char direction, unsigned char *pointer, int length)
/* case OLD_ENV_VALUE: */
if (pointer[0] == TELOPT_OLD_ENVIRON) {
# ifdef ENV_HACK
- if (old_env_value == OLD_ENV_VAR)
- fprintf(NetTrace, "\" (VAR) " + noquote);
- else
+ if (old_env_value == OLD_ENV_VAR) {
+ msg = "\" (VAR) ";
+ fprintf(NetTrace, "%s", msg + noquote);
+ }
+ else {
# endif
- fprintf(NetTrace, "\" VALUE " + noquote);
- } else
+ msg = "\" VALUE ";
+ fprintf(NetTrace, "%s", msg + noquote);
+# ifdef ENV_HACK
+ }
+# endif
+ } else {
#endif /* OLD_ENVIRON */
- fprintf(NetTrace, "\" VAR " + noquote);
+ msg = "\" VAR ";
+ fprintf(NetTrace, "%s", msg + noquote);
+#ifdef OLD_ENVIRON
+ }
+#endif
noquote = 2;
break;
case ENV_ESC:
- fprintf(NetTrace, "\" ESC " + noquote);
+ msg = "\" ESC ";
+ fprintf(NetTrace, "%s", msg + noquote);
noquote = 2;
break;
case ENV_USERVAR:
- fprintf(NetTrace, "\" USERVAR " + noquote);
+ msg = "\" USERVAR ";
+ fprintf(NetTrace, "%s", msg + noquote);
noquote = 2;
break;
diff --git a/telnetd/utility.c b/telnetd/utility.c
index 4a438be..82edee5 100644
--- a/telnetd/utility.c
+++ b/telnetd/utility.c
@@ -969,22 +969,26 @@ printsub(char direction, unsigned char *pointer, int length)
env_common:
{
register int noquote = 2;
+ char* msg;
for (i = 2; i < length; i++ ) {
switch (pointer[i]) {
case ENV_VAR:
if (pointer[1] == TELQUAL_SEND)
goto def_case;
- netoprintf("\" VAR " + noquote);
+ msg = "\" VAR ";
+ netoprintf("%s", msg + noquote);
noquote = 2;
break;
case ENV_VALUE:
- netoprintf("\" VALUE " + noquote);
+ msg = "\" VALUE ";
+ netoprintf("%s", msg + noquote);
noquote = 2;
break;
case ENV_ESC:
- netoprintf("\" ESC " + noquote);
+ msg = "\" ESC ";
+ netoprintf("%s", msg + noquote);
noquote = 2;
break;

View File

@ -0,0 +1,15 @@
diff --git a/telnet/telnet.1 b/telnet/telnet.1
index f30e034..e3a873e 100644
--- a/telnet/telnet.1
+++ b/telnet/telnet.1
@@ -74,6 +74,10 @@ If it is invoked with arguments, it performs an
.Ic open
command with those arguments.
.Pp
+If a hostname is resolved to multiple IP addresses,
+.Nm
+attempts to establish a connection with each address until one of them is successful or until no more addresses are left.
+.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl 4

View File

@ -3,7 +3,7 @@
Summary: The client program for the Telnet remote login protocol
Name: telnet
Version: 0.17
Release: 68%{?dist}
Release: 69%{?dist}
Epoch: 1
License: BSD
Group: Applications/Internet
@ -37,6 +37,8 @@ Patch25: telnet-rh704604.patch
Patch26: telnet-rh825946.patch
Patch27: telnet-0.17-force-ipv6-ipv4.patch
Patch28: netkit-telnet-0.17-core-dump.patch
Patch29: netkit-telnet-0.17-gcc7.patch
Patch30: netkit-telnet-0.17-manpage.patch
BuildRequires: ncurses-devel systemd
BuildRequires: perl
@ -89,6 +91,8 @@ mv telnet telnet-NETKIT
%patch26 -p1 -b .rh825946
%patch27 -p1 -b .ipv6-support
%patch28 -p1 -b .core-dump
%patch29 -p1 -b .gcc7
%patch30 -p1 -b .manpage
%build
%ifarch s390 s390x
@ -154,6 +158,10 @@ install -p -m644 %SOURCE6 ${RPM_BUILD_ROOT}%{_unitdir}/telnet.socket
%{_mandir}/man8/telnetd.8*
%changelog
* Tue Apr 25 2017 Michal Ruprich <mruprich@redhat.com> - 1:0.17-69
- Resolves: #1445259 - telnet won't build with latest gcc
- added note about address resolution in manpage
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.17-68
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild