summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-06-27 19:08:14 -0700
committerArmin Kuster <akuster808@gmail.com>2017-09-13 17:24:46 -0700
commit18ddc5ce6314334bbd25e42b80de43d7e364bf40 (patch)
treea2340ec07b378e614477dacc203b4e34f1a7ecd7
parent365493fc3362084b7d97dc41c2e599d32ceb490e (diff)
downloadmeta-openembedded-18ddc5ce6314334bbd25e42b80de43d7e364bf40.tar.gz
netkit-telnet: Fix build with hardening
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com> (cherry picked from commit 6b0fb999ac3bacb0e52b03b1198e2ead6ae95ec8) Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-networking/recipes-netkit/netkit-telnet/files/0001-telnet-telnetd-Fix-print-format-strings.patch66
-rw-r--r--meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb11
2 files changed, 72 insertions, 5 deletions
diff --git a/meta-networking/recipes-netkit/netkit-telnet/files/0001-telnet-telnetd-Fix-print-format-strings.patch b/meta-networking/recipes-netkit/netkit-telnet/files/0001-telnet-telnetd-Fix-print-format-strings.patch
new file mode 100644
index 000000000..f2f1b12e2
--- /dev/null
+++ b/meta-networking/recipes-netkit/netkit-telnet/files/0001-telnet-telnetd-Fix-print-format-strings.patch
@@ -0,0 +1,66 @@
1From 7a3095d1e9b7c73f9dca56250f433bcfc7cb660e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 27 Jun 2017 10:15:34 -0700
4Subject: [PATCH] telnet/telnetd: Fix print format strings
5
6Fixes build with hardening flags
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 telnet/utilities.cc | 6 +++---
11 telnetd/utility.c | 6 +++---
12 2 files changed, 6 insertions(+), 6 deletions(-)
13
14diff --git a/telnet/utilities.cc b/telnet/utilities.cc
15index 66839ab..36f0731 100644
16--- a/telnet/utilities.cc
17+++ b/telnet/utilities.cc
18@@ -583,17 +583,17 @@ void printsub(int direction, unsigned char *pointer, int length) {
19 case ENV_VAR:
20 if (pointer[1] == TELQUAL_SEND)
21 goto def_case;
22- fprintf(NetTrace, "\" VAR " + noquote);
23+ fprintf(NetTrace, "%s", "\" VAR " + noquote);
24 noquote = 2;
25 break;
26
27 case ENV_VALUE:
28- fprintf(NetTrace, "\" VALUE " + noquote);
29+ fprintf(NetTrace, "%s", "\" VALUE " + noquote);
30 noquote = 2;
31 break;
32
33 case ENV_ESC:
34- fprintf(NetTrace, "\" ESC " + noquote);
35+ fprintf(NetTrace, "%s", "\" ESC " + noquote);
36 noquote = 2;
37 break;
38
39diff --git a/telnetd/utility.c b/telnetd/utility.c
40index 29b7da1..75314cb 100644
41--- a/telnetd/utility.c
42+++ b/telnetd/utility.c
43@@ -909,17 +909,17 @@ printsub(char direction, unsigned char *pointer, int length)
44 case ENV_VAR:
45 if (pointer[1] == TELQUAL_SEND)
46 goto def_case;
47- netoprintf("\" VAR " + noquote);
48+ netoprintf("%s", "\" VAR " + noquote);
49 noquote = 2;
50 break;
51
52 case ENV_VALUE:
53- netoprintf("\" VALUE " + noquote);
54+ netoprintf("%s", "\" VALUE " + noquote);
55 noquote = 2;
56 break;
57
58 case ENV_ESC:
59- netoprintf("\" ESC " + noquote);
60+ netoprintf("%s", "\" ESC " + noquote);
61 noquote = 2;
62 break;
63
64--
652.13.2
66
diff --git a/meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb b/meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb
index 9438adc0f..54a58c8a1 100644
--- a/meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb
+++ b/meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb
@@ -5,11 +5,12 @@ LICENSE = "BSD"
5LIC_FILES_CHKSUM = "file://telnet/telnet.cc;beginline=2;endline=3;md5=780868e7b566313e70cb701560ca95ef" 5LIC_FILES_CHKSUM = "file://telnet/telnet.cc;beginline=2;endline=3;md5=780868e7b566313e70cb701560ca95ef"
6 6
7SRC_URI = "ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/${BP}.tar.gz \ 7SRC_URI = "ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/${BP}.tar.gz \
8 file://To-aviod-buffer-overflow-in-telnet.patch \ 8 file://To-aviod-buffer-overflow-in-telnet.patch \
9 file://Warning-fix-in-the-step-of-install.patch \ 9 file://Warning-fix-in-the-step-of-install.patch \
10 file://telnet-xinetd \ 10 file://telnet-xinetd \
11 file://cross-compile.patch \ 11 file://cross-compile.patch \
12" 12 file://0001-telnet-telnetd-Fix-print-format-strings.patch \
13 "
13 14
14EXTRA_OEMAKE = "INSTALLROOT=${D} SBINDIR=${sbindir} DAEMONMODE=755 \ 15EXTRA_OEMAKE = "INSTALLROOT=${D} SBINDIR=${sbindir} DAEMONMODE=755 \
15 MANMODE=644 MANDIR=${mandir}" 16 MANMODE=644 MANDIR=${mandir}"