From 312ef932540fd080cf8b064085ced24109b43d65 Mon Sep 17 00:00:00 2001 From: wk333 <13474090681@163.com> Date: Thu, 7 Apr 2022 17:22:27 +0800 Subject: [PATCH] fix build error --- ...-use-s-style-format-for-printf-style.patch | 39 +++++++++++++++++++ 0002-fix-error-format-in-gfs2hex.patch | 25 ++++++++++++ gfs2-utils.spec | 8 +++- 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 0001-gfs2-edit-always-use-s-style-format-for-printf-style.patch create mode 100644 0002-fix-error-format-in-gfs2hex.patch diff --git a/0001-gfs2-edit-always-use-s-style-format-for-printf-style.patch b/0001-gfs2-edit-always-use-s-style-format-for-printf-style.patch new file mode 100644 index 0000000..77d6caa --- /dev/null +++ b/0001-gfs2-edit-always-use-s-style-format-for-printf-style.patch @@ -0,0 +1,39 @@ +From 17fb470356a6d55988f05ac70f06b382ef982604 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Sun, 7 Nov 2021 09:00:31 +0000 +Subject: [PATCH] gfs2/edit: always use "%s"-style format for printf()-style + functions + +`ncurses-6.3` added printf-style function attributes and now makes +it easier to catch cases when user input is used in place of format +string when built with CFLAGS=-Werror=format-security: + + hexedit.c:227:9: error: format not a string literal and no format arguments [-Werror=format-security] + 227 | printw(s2); + | ^~~~~~ + +Let's wrap all the missing places with "%s" format. +--- + gfs2/edit/hexedit.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c +index 798639b5..88ee3e5f 100644 +--- a/gfs2/edit/hexedit.c ++++ b/gfs2/edit/hexedit.c +@@ -221,10 +221,10 @@ static void gfs2instr(const char *s1, const char *s2) + { + COLORS_HIGHLIGHT; + move(line,0); +- printw(s1); ++ printw("%s", s1); + COLORS_NORMAL; + move(line,17); +- printw(s2); ++ printw("%s", s2); + line++; + } + +-- +2.27.0 + diff --git a/0002-fix-error-format-in-gfs2hex.patch b/0002-fix-error-format-in-gfs2hex.patch new file mode 100644 index 0000000..27ef0a4 --- /dev/null +++ b/0002-fix-error-format-in-gfs2hex.patch @@ -0,0 +1,25 @@ +From f2cced91a440de26b30adf6a82f8bd459a04a4c2 Mon Sep 17 00:00:00 2001 +From: penelope +Date: Thu, 10 Mar 2022 21:30:47 +0800 +Subject: [PATCH] fix error format in gfs2hex + +--- + gfs2/edit/gfs2hex.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c +index 62d5cab..b8c027e 100644 +--- a/gfs2/edit/gfs2hex.c ++++ b/gfs2/edit/gfs2hex.c +@@ -376,7 +376,7 @@ static void gfs2_inum_print2(const char *title,struct gfs2_inum *no) + if (termlines) { + check_highlight(TRUE); + move(line,2); +- printw(title); ++ printw("%s",title); + check_highlight(FALSE); + } + else +-- +2.27.0 + diff --git a/gfs2-utils.spec b/gfs2-utils.spec index aae3839..6706159 100644 --- a/gfs2-utils.spec +++ b/gfs2-utils.spec @@ -1,11 +1,14 @@ Name: gfs2-utils Version: 3.4.1 -Release: 1 +Release: 2 Summary: Utilities for managing the global file system (GFS2) License: GPLv2+ and LGPLv2+ URL: https://pagure.io/gfs2-utils Source0: https://releases.pagure.org/gfs2-utils/gfs2-utils-%{version}.tar.gz +# https://github.com/andyprice/gfs2-utils/commit/17fb470 +Patch0: 0001-gfs2-edit-always-use-s-style-format-for-printf-style.patch +Patch1: 0002-fix-error-format-in-gfs2hex.patch BuildRequires: ncurses-devel kernel-headers automake libtool zlib-devel gettext-devel BuildRequires: bison flex libblkid-devel libuuid-devel check-devel bzip2-devel make @@ -51,6 +54,9 @@ rm -f %{buildroot}%{_mandir}/man8/gfs2_lockcapture.8 %changelog +* Thu Apr 07 2022 wangkai - 3.4.1-2 +- fix build error + * Mon Dec 27 2021 wangyangli - 3.4.1-1 - upgrade to 3.4.1 -- Gitee