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 f2e546c3e0aca987b0b0fbb4190e3abcdb8ea579..639cd4f684a3aa6b620d11caf7c6e09557f344fb 100644 --- a/fcoe-utils.spec +++ b/fcoe-utils.spec @@ -1,6 +1,6 @@ Name: fcoe-utils Version: 1.0.33 -Release: 6 +Release: 7 Summary: Fibre Channel over Ethernet utilities License: GPLv2 URL: https://github.com/morbidrsa/fcoe-utils @@ -15,6 +15,7 @@ Patch4: backport-Fix-build-error-to-change-char-type.patch Patch5: backport-handle-NIC-names-longer-than-7-characters.patch Patch6: bachport-Fix-GCC-12-warning.patch Patch7: backport-Fix-two-gcc-11-compiler-warnings.patch +Patch8: 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 @@ -70,6 +71,9 @@ done %{_mandir}/man8/* %changelog +* Thu Dec 28 2023 liyuanyuan - 1.0.33-7 +- fix regressions caused by safe_makepath change in libopenfcoe.c + * Thu Dec 21 2023 liyuanyuan - 1.0.33-6 - Fix two gcc-11 compiler warnings