fix build error
This commit is contained in:
parent
ad1792cdd7
commit
312ef93254
@ -0,0 +1,39 @@
|
||||
From 17fb470356a6d55988f05ac70f06b382ef982604 Mon Sep 17 00:00:00 2001
|
||||
From: Sergei Trofimovich <slyich@gmail.com>
|
||||
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
|
||||
|
||||
25
0002-fix-error-format-in-gfs2hex.patch
Normal file
25
0002-fix-error-format-in-gfs2hex.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From f2cced91a440de26b30adf6a82f8bd459a04a4c2 Mon Sep 17 00:00:00 2001
|
||||
From: penelope <anchor_cool@163.com>
|
||||
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
|
||||
|
||||
@ -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 <wangkai@h-partners.com> - 3.4.1-2
|
||||
- fix build error
|
||||
|
||||
* Mon Dec 27 2021 wangyangli <wangyangli@kylinos.cn> - 3.4.1-1
|
||||
- upgrade to 3.4.1
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user