From 01ae06ae43e58e8f0d0bb2ae69b3ebe331b69f80 Mon Sep 17 00:00:00 2001 From: wu-leilei Date: Mon, 9 May 2022 11:34:07 +0800 Subject: [PATCH] Fix traffic_top build when using -Werror=format-security --- ...ld-when-using-Werror-format-security.patch | 35 +++++++++++++++++++ trafficserver.spec | 9 +++-- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 Fix-traffic_top-build-when-using-Werror-format-security.patch diff --git a/Fix-traffic_top-build-when-using-Werror-format-security.patch b/Fix-traffic_top-build-when-using-Werror-format-security.patch new file mode 100644 index 0000000..12b30a0 --- /dev/null +++ b/Fix-traffic_top-build-when-using-Werror-format-security.patch @@ -0,0 +1,35 @@ +From 7a93f208f32889ca5eb285dda87a4912fa30886a Mon Sep 17 00:00:00 2001 +From: Jean-Baptiste Favre +Date: Tue, 19 Oct 2021 08:42:04 +0200 +Subject: [PATCH] Fix traffic_top build when using -Werror=format-security +Reference: https://github.com/apache/trafficserver/pull/8437 + +--- + src/traffic_top/traffic_top.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/traffic_top/traffic_top.cc b/src/traffic_top/traffic_top.cc +index d33d682..2ac6b2a 100644 +--- a/src/traffic_top/traffic_top.cc ++++ b/src/traffic_top/traffic_top.cc +@@ -126,7 +126,7 @@ prettyPrint(const int x, const int y, const double number, const int type) + } + attron(COLOR_PAIR(color)); + attron(A_BOLD); +- mvprintw(y, x, buffer); ++ mvprintw(y, x, "%s", buffer); + attroff(COLOR_PAIR(color)); + attroff(A_BOLD); + } +@@ -143,7 +143,7 @@ makeTable(const int x, const int y, const list &items, Stats &stats) + int type; + + stats.getStat(item, value, prettyName, type); +- mvprintw(my_y, x, prettyName.c_str()); ++ mvprintw(my_y, x, "%s", prettyName.c_str()); + prettyPrint(x + 10, my_y++, value, type); + } + } +-- +2.27.0 + diff --git a/trafficserver.spec b/trafficserver.spec index 6c3ca82..3729392 100644 --- a/trafficserver.spec +++ b/trafficserver.spec @@ -2,7 +2,7 @@ %{!?release: %define release 2} Name: trafficserver Version: 9.1.0 -Release: 4 +Release: 5 Summary: Apache Traffic Server, a reverse, forward and transparent HTTP proxy cache License: Apache-2.0 URL: https://trafficserver.apache.org/ @@ -13,7 +13,8 @@ Patch0002: CVE-2021-37149.patch Patch0003: CVE-2021-41585.patch Patch0004: CVE-2021-43082.patch Patch0005: Fix-status-failure-after-stopping-service.patch -Patch0006: Fix-log-in-debug-mode.patch +Patch0006: Fix-log-in-debug-mode.patch +Patch0007: Fix-traffic_top-build-when-using-Werror-format-security.patch BuildRequires: expat-devel hwloc-devel openssl-devel pcre-devel zlib-devel xz-devel BuildRequires: libcurl-devel ncurses-devel gcc gcc-c++ perl-ExtUtils-MakeMaker BuildRequires: libcap-devel cmake libunwind-devel automake @@ -40,6 +41,7 @@ This package contains some Perl APIs for talking to the ATS management port. %autosetup -n %{name}-%{version} -p1 %build +autoreconf %configure \ --enable-layout=Gentoo \ --libdir=%{_libdir}/trafficserver \ @@ -117,6 +119,9 @@ getent passwd ats >/dev/null || useradd -r -u 176 -g ats -d / -s /sbin/nologin - %{_datadir}/pkgconfig/trafficserver.pc %changelog +* Mon May 09 2022 wulei - 9.1.0-5 +- Fix traffic_top build when using -Werror=format-security + * Sat Nov 13 2021 caodongxia - 9.1.0-4 - fix log in debug mode -- Gitee