From 81c389b2f2cfde672f4988e7e0f7875f209efda4 Mon Sep 17 00:00:00 2001 From: baiguo Date: Tue, 2 Apr 2024 16:44:58 +0800 Subject: [PATCH] Correct HBA Mode and Correct hashlib.md5-usage (cherry picked from commit 7a6a5c3ca5b9feb7288bcad254fa9ebf4f4c45c6) --- ...A-Mode-and-Correct-hashlib.md5-usage.patch | 41 +++++++++++++++++++ libstoragemgmt.spec | 6 ++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 0001-Correct-HBA-Mode-and-Correct-hashlib.md5-usage.patch diff --git a/0001-Correct-HBA-Mode-and-Correct-hashlib.md5-usage.patch b/0001-Correct-HBA-Mode-and-Correct-hashlib.md5-usage.patch new file mode 100644 index 0000000..2cc87c3 --- /dev/null +++ b/0001-Correct-HBA-Mode-and-Correct-hashlib.md5-usage.patch @@ -0,0 +1,41 @@ +From b49d3f24c6916e7954869bc159eac4861c67f9b0 Mon Sep 17 00:00:00 2001 +From: tasleson tasleson@redhat.com +Date: Tue, 2 Apr 2024 16:21:03 +0800 +Subject: [PATCH] Correct HBA-Mode and Correct hashlib.md5 usage + +--- + plugin/megaraid_plugin/megaraid.py | 2 +- + test/cmdtest.py.in | 4 ++++ + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/plugin/megaraid_plugin/megaraid.py b/plugin/megaraid_plugin/megaraid.py +index eee7233..9004262 100644 +--- a/plugin/megaraid_plugin/megaraid.py ++++ b/plugin/megaraid_plugin/megaraid.py +@@ -547,7 +547,7 @@ class MegaRAID(IPlugin): + if ctrl_show_all_output["Status"]["Current Personality"] == "HBA-Mode ": + mode = System.MODE_HBA + else: +- mode = System.MODE_HBA ++ mode = System.MODE_HARDWARE_RAID + else: + mode = System.MODE_UNKNOWN + +diff --git a/test/cmdtest.py.in b/test/cmdtest.py.in +index 273f07d..46d3379 100755 +--- a/test/cmdtest.py.in ++++ b/test/cmdtest.py.in +@@ -65,6 +65,10 @@ def random_iqn(): + + s = "iqn.1994-05.com.domain:01." + m = hashlib.md5() ++ try: ++ m = hashlib.md5(usedforsecurity=False) ++ except Exception: ++ m = hashlib.md5() + u = os.uname() + for i in u: + m.update(i.encode('utf-8')) +-- +2.27.0 + diff --git a/libstoragemgmt.spec b/libstoragemgmt.spec index a4ab1d7..991ce7b 100644 --- a/libstoragemgmt.spec +++ b/libstoragemgmt.spec @@ -2,11 +2,12 @@ %define with_python2 0 Name: libstoragemgmt Version: 1.9.8 -Release: 1 +Release: 2 Summary: Storage array management library License: LGPLv2+ URL: https://github.com/libstorage/libstoragemgmt Source0: https://github.com/libstorage/libstoragemgmt/releases/download/%{version}/%{name}-%{version}.tar.gz +Patch1: 0001-Correct-HBA-Mode-and-Correct-hashlib.md5-usage.patch BuildRequires: gcc gcc-c++ autoconf automake libtool libxml2-devel check-devel perl-interpreter BuildRequires: glib2-devel systemd bash-completion libconfig-devel systemd-devel @@ -403,6 +404,9 @@ fi %{_mandir}/man*/* %changelog +* Tue Apr 2 2024 wulei - 1.9.8-2 +- Correct HBA Mode and Correct hashlib.md5 usage + * Wed Oct 11 2023 wulei - 1.9.8-1 - Update to 1.9.8 -- Gitee