diff --git a/backport-fix-regressions-caused-by-safe_makepath-change-in-li.patch b/backport-fix-regressions-caused-by-safe_makepath-change-in-li.patch new file mode 100644 index 0000000000000000000000000000000000000000..52bbdb581170116ef0fb45d184d87a230e3a8f50 --- /dev/null +++ b/backport-fix-regressions-caused-by-safe_makepath-change-in-li.patch @@ -0,0 +1,35 @@ +From 108387a2aa986a8107faa7548f3f9e9c084749d2 Mon Sep 17 00:00:00 2001 +From: Chris Leech +Date: Wed, 24 Mar 2021 09:50:51 -0700 +Subject: [PATCH] fix regressions caused by safe_makepath change in + libopenfcoe.c + +This needs to use strlen(dname) not sizeof(dname) or the directory path +is truncated. On a 64-bit arch an 8 byte truncation kind of looks like +a valid path '/sys/bus' which is sort of funny unless you're debugging +it. + +This caused fcoeadm --fcf to fail to read in FCF info, and fcoeadm +--lesb to fail to find the link error status block counters. + +Signed-off-by: Chris Leech +--- + libopenfcoe.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libopenfcoe.c b/libopenfcoe.c +index 452ee803e63..cd35c868eee 100644 +--- a/libopenfcoe.c ++++ b/libopenfcoe.c +@@ -58,7 +58,7 @@ out_err: + static char *safe_makepath(char *path, size_t path_sz, + char *dname, char *fname) + { +- size_t dsz = sizeof(dname); ++ size_t dsz = strlen(dname); + size_t fsz = strlen(fname); + char *cp = path; + +-- +2.33.0 + diff --git a/fcoe-utils.spec b/fcoe-utils.spec index a4a0f630b1d6ab4ab48c872c0088fcbafb0963d4..dc4b4c65e93481759f9ef74c8fdfd5de5cc63c88 100644 --- a/fcoe-utils.spec +++ b/fcoe-utils.spec @@ -1,6 +1,6 @@ Name: fcoe-utils Version: 1.0.33 -Release: 4 +Release: 5 Summary: Fibre Channel over Ethernet utilities License: GPLv2 URL: https://github.com/morbidrsa/fcoe-utils @@ -13,6 +13,7 @@ Patch3: backport-03-use-of-uninitialized-values-detected-during-LTO. #This patch refer to ubuntu's version Patch4: backport-Fix-build-error-to-change-char-type.patch Patch5: backport-Fix-two-gcc-11-compiler-warnings.patch +Patch6: backport-fix-regressions-caused-by-safe_makepath-change-in-li.patch BuildRequires: autoconf automake libpciaccess-devel libtool lldpad-devel systemd Requires: lldpad iproute device-mapper-multipath @@ -68,6 +69,9 @@ done %{_mandir}/man8/* %changelog +* Thu Dec 28 2023 liyuanyuan - 1.0.33-5 +- fix regressions caused by safe_makepath change in libopenfcoe.c + * Thu Dec 21 2023 liyuanyuan - 1.0.33-4 - Fix two gcc-11 compiler warnings