* Mon Aug 16 2021 Tomas Bzatek <tbzatek@redhat.com> - 0.32-5
- Rebase to proper upstream 0.32 release (r167) - Fix WWN ID truncation (#1981038) Resolves: #1981351
This commit is contained in:
parent
cd14fa1358
commit
66f21127fd
@ -1,34 +0,0 @@
|
|||||||
From db8d419ba39e4547de602ef1ff58cd97d5e1102d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
|
||||||
Date: Wed, 11 Nov 2020 15:39:16 +0100
|
|
||||||
Subject: [PATCH] fix uninitialized variable
|
|
||||||
|
|
||||||
Error: UNINIT (CWE-457): [#def1]
|
|
||||||
lsscsi-032r164/src/lsscsi.c:3341: var_decl: Declaring variable "type" without initializer.
|
|
||||||
lsscsi-032r164/src/lsscsi.c:3586: uninit_use_in_call: Using uninitialized value "type" when calling "is_direct_access_dev".
|
|
||||||
3584| my_strcopy(blkdir, buff, sizeof(blkdir));
|
|
||||||
3585| value[0] = 0;
|
|
||||||
3586|-> if (! (is_direct_access_dev(type) &&
|
|
||||||
3587| block_scan(blkdir) &&
|
|
||||||
3588| if_directory_chdir(blkdir, ".") &&
|
|
||||||
---
|
|
||||||
src/lsscsi.c | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/lsscsi.c b/src/lsscsi.c
|
|
||||||
index 6544153..8a30299 100644
|
|
||||||
--- a/src/lsscsi.c
|
|
||||||
+++ b/src/lsscsi.c
|
|
||||||
@@ -3338,7 +3338,8 @@ one_sdev_entry(const char * dir_name, const char * devname,
|
|
||||||
const struct lsscsi_opts * op)
|
|
||||||
{
|
|
||||||
bool get_wwn = false;
|
|
||||||
- int type, n, vlen;
|
|
||||||
+ int type = 0;
|
|
||||||
+ int n, vlen;
|
|
||||||
int devname_len = 13;
|
|
||||||
char buff[LMAX_DEVPATH];
|
|
||||||
char extra[LMAX_DEVPATH];
|
|
||||||
--
|
|
||||||
2.26.2
|
|
||||||
|
|
25
lsscsi-0.33-wwn-trunc.patch
Normal file
25
lsscsi-0.33-wwn-trunc.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From c13c9d3a90aec4779a0cbe484913f24bce947ab1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Wenchao Hao <haowenchao@huawei.com>
|
||||||
|
Date: Tue, 8 Jun 2021 16:26:04 +0800
|
||||||
|
Subject: [PATCH] Fix lsscsi wwn number output error
|
||||||
|
|
||||||
|
The true wwn number is from the sixth byte of scsi-*
|
||||||
|
|
||||||
|
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
||||||
|
---
|
||||||
|
src/lsscsi.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/lsscsi.c b/src/lsscsi.c
|
||||||
|
index 6f6953f..2be3ab9 100644
|
||||||
|
--- a/src/lsscsi.c
|
||||||
|
+++ b/src/lsscsi.c
|
||||||
|
@@ -1515,7 +1515,7 @@ collect_disk_wwn_nodes(void)
|
||||||
|
|
||||||
|
cur_ent = &cur_list->nodes[cur_list->count];
|
||||||
|
my_strcopy(cur_ent->wwn, "0x", 3);
|
||||||
|
- my_strcopy(cur_ent->wwn + 2, dep->d_name + 5,
|
||||||
|
+ my_strcopy(cur_ent->wwn + 2, dep->d_name + 6,
|
||||||
|
sizeof(cur_ent->wwn) - 2);
|
||||||
|
my_strcopy(cur_ent->disk_bname, basename(symlink_path),
|
||||||
|
sizeof(cur_ent->disk_bname));
|
11
lsscsi.spec
11
lsscsi.spec
@ -1,14 +1,15 @@
|
|||||||
Summary: List SCSI devices (or hosts) and associated information
|
Summary: List SCSI devices (or hosts) and associated information
|
||||||
Name: lsscsi
|
Name: lsscsi
|
||||||
Version: 0.32
|
Version: 0.32
|
||||||
Release: 4%{?dist}
|
Release: 5%{?dist}
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
# official git repository: https://github.com/doug-gilbert/lsscsi
|
# official git repository: https://github.com/doug-gilbert/lsscsi
|
||||||
Source0: http://sg.danny.cz/scsi/%{name}-%{version}.tgz
|
Source0: http://sg.danny.cz/scsi/%{name}-%{version}.tgz
|
||||||
URL: http://sg.danny.cz/scsi/lsscsi.html
|
URL: http://sg.danny.cz/scsi/lsscsi.html
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
Patch0: lsscsi-0.32-fix-uninitialized-variable.patch
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1981038
|
||||||
|
Patch0: lsscsi-0.33-wwn-trunc.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Uses information provided by the sysfs pseudo file system in Linux kernel
|
Uses information provided by the sysfs pseudo file system in Linux kernel
|
||||||
@ -22,7 +23,7 @@ Author:
|
|||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p 1 -n %{name}-032r164
|
%autosetup -p 1 -n %{name}-0.32
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure
|
%configure
|
||||||
@ -40,6 +41,10 @@ Author:
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Aug 16 2021 Tomas Bzatek <tbzatek@redhat.com> - 0.32-5
|
||||||
|
- Rebase to proper upstream 0.32 release (r167)
|
||||||
|
- Fix WWN ID truncation (#1981038)
|
||||||
|
|
||||||
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.32-4
|
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.32-4
|
||||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||||
Related: rhbz#1991688
|
Related: rhbz#1991688
|
||||||
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (lsscsi-0.32.tgz) = 8755e6bbdb8daaf6ab28a62c8b3a10e1f57b70590a0da03e9a8bc96954b17606444e7f5577af2b176aa06d89244d9a5dd3f91251694676ba1dac1543b3788fb9
|
SHA512 (lsscsi-0.32.tgz) = 96cb87be53eae9fa3a7defa0065f4dee8ccc23805a9ed1dc93d101c5e0610b78765b61449bf6ce58c13de8aae8400e4ac6a60ad64f840d092b9d7293106c5145
|
||||||
|
Loading…
Reference in New Issue
Block a user