diff options
| author | Khem Raj <raj.khem@gmail.com> | 2017-06-27 19:08:14 -0700 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2017-09-13 17:24:46 -0700 |
| commit | 18ddc5ce6314334bbd25e42b80de43d7e364bf40 (patch) | |
| tree | a2340ec07b378e614477dacc203b4e34f1a7ecd7 | |
| parent | 365493fc3362084b7d97dc41c2e599d32ceb490e (diff) | |
| download | meta-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.patch | 66 | ||||
| -rw-r--r-- | meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb | 11 |
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 0000000000..f2f1b12e28 --- /dev/null +++ b/meta-networking/recipes-netkit/netkit-telnet/files/0001-telnet-telnetd-Fix-print-format-strings.patch | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | From 7a3095d1e9b7c73f9dca56250f433bcfc7cb660e Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 27 Jun 2017 10:15:34 -0700 | ||
| 4 | Subject: [PATCH] telnet/telnetd: Fix print format strings | ||
| 5 | |||
| 6 | Fixes build with hardening flags | ||
| 7 | |||
| 8 | Signed-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 | |||
| 14 | diff --git a/telnet/utilities.cc b/telnet/utilities.cc | ||
| 15 | index 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 | |||
| 39 | diff --git a/telnetd/utility.c b/telnetd/utility.c | ||
| 40 | index 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 | -- | ||
| 65 | 2.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 9438adc0f2..54a58c8a11 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" | |||
| 5 | LIC_FILES_CHKSUM = "file://telnet/telnet.cc;beginline=2;endline=3;md5=780868e7b566313e70cb701560ca95ef" | 5 | LIC_FILES_CHKSUM = "file://telnet/telnet.cc;beginline=2;endline=3;md5=780868e7b566313e70cb701560ca95ef" |
| 6 | 6 | ||
| 7 | SRC_URI = "ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/${BP}.tar.gz \ | 7 | SRC_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 | ||
| 14 | EXTRA_OEMAKE = "INSTALLROOT=${D} SBINDIR=${sbindir} DAEMONMODE=755 \ | 15 | EXTRA_OEMAKE = "INSTALLROOT=${D} SBINDIR=${sbindir} DAEMONMODE=755 \ |
| 15 | MANMODE=644 MANDIR=${mandir}" | 16 | MANMODE=644 MANDIR=${mandir}" |
