backport mkfs.gfs2: Fix strncpy warnings
This commit is contained in:
parent
3354ba449c
commit
784ce06709
36
0007-mkfs.gfs2-Fix-strncpy-warnings.patch
Normal file
36
0007-mkfs.gfs2-Fix-strncpy-warnings.patch
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
From 7cff23e49b7a80486e522fee5a645cd9b143c7c3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andrew Price <anprice@redhat.com>
|
||||||
|
Date: Sat, 23 May 2020 15:05:43 +0100
|
||||||
|
Subject: [PATCH] mkfs.gfs2: Fix strncpy warnings
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
New in gcc 10
|
||||||
|
|
||||||
|
warning: ‘__builtin_strncpy’ specified bound 64 equals destination size
|
||||||
|
[-Wstringop-truncation]
|
||||||
|
|
||||||
|
Signed-off-by: Andrew Price <anprice@redhat.com>
|
||||||
|
---
|
||||||
|
gfs2/mkfs/main_mkfs.c | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
|
||||||
|
index bb8762b0..36fd08e7 100644
|
||||||
|
--- a/gfs2/mkfs/main_mkfs.c
|
||||||
|
+++ b/gfs2/mkfs/main_mkfs.c
|
||||||
|
@@ -1144,8 +1144,8 @@ int main(int argc, char *argv[])
|
||||||
|
build_root(&sbd);
|
||||||
|
sb.sb_root_dir = sbd.md.rooti->i_di.di_num;
|
||||||
|
|
||||||
|
- strncpy(sb.sb_lockproto, opts.lockproto, GFS2_LOCKNAME_LEN);
|
||||||
|
- strncpy(sb.sb_locktable, opts.locktable, GFS2_LOCKNAME_LEN);
|
||||||
|
+ strncpy(sb.sb_lockproto, opts.lockproto, GFS2_LOCKNAME_LEN - 1);
|
||||||
|
+ strncpy(sb.sb_locktable, opts.locktable, GFS2_LOCKNAME_LEN - 1);
|
||||||
|
sb.sb_lockproto[GFS2_LOCKNAME_LEN - 1] = '\0';
|
||||||
|
sb.sb_locktable[GFS2_LOCKNAME_LEN - 1] = '\0';
|
||||||
|
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
Name: gfs2-utils
|
Name: gfs2-utils
|
||||||
Version: 3.2.0
|
Version: 3.2.0
|
||||||
Release: 11
|
Release: 12
|
||||||
Summary: Global Filesystem Utilities
|
Summary: Global Filesystem Utilities
|
||||||
|
|
||||||
License: GPLv2+ and LGPLv2+
|
License: GPLv2+ and LGPLv2+
|
||||||
@ -13,6 +13,7 @@ Patch0003: 0003-fsck.gfs2-Fix-segfault-in-build_and_check_metalist.patch
|
|||||||
Patch0004: 0004-gfs2_jadd-Handle-out-of-space-issues.patch
|
Patch0004: 0004-gfs2_jadd-Handle-out-of-space-issues.patch
|
||||||
Patch0005: 0005--gfs2_jadd-error-handling-overhaul.patch
|
Patch0005: 0005--gfs2_jadd-error-handling-overhaul.patch
|
||||||
Patch0006: 0006-gfs2_jadd-Fix-static-analysis-warnings.patch
|
Patch0006: 0006-gfs2_jadd-Fix-static-analysis-warnings.patch
|
||||||
|
Patch0007: 0007-mkfs.gfs2-Fix-strncpy-warnings.patch
|
||||||
|
|
||||||
BuildRequires: ncurses-devel kernel-headers automake libtool zlib-devel gettext-devel
|
BuildRequires: ncurses-devel kernel-headers automake libtool zlib-devel gettext-devel
|
||||||
BuildRequires: bison flex libblkid-devel libuuid-devel check-devel
|
BuildRequires: bison flex libblkid-devel libuuid-devel check-devel
|
||||||
@ -58,6 +59,9 @@ make -C gfs2 install DESTDIR=%{buildroot}
|
|||||||
%exclude %{_mandir}/man8/gfs2_lockcapture.8.gz
|
%exclude %{_mandir}/man8/gfs2_lockcapture.8.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Dec 28 2023 liyuanyuan <liyuanyuan@xfusion.com> - 3.2.0-12
|
||||||
|
- mkfs.gfs2: Fix strncpy warnings
|
||||||
|
|
||||||
* Tue Dec 12 2023 liyuanyuan <liyuanyuan@xfusion.com> - 3.2.0-11
|
* Tue Dec 12 2023 liyuanyuan <liyuanyuan@xfusion.com> - 3.2.0-11
|
||||||
- gfs2_jadd: Fix static analysis warningS
|
- gfs2_jadd: Fix static analysis warningS
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user