From 0af74ce409cd66dc2034a034f4868a070d620e3e Mon Sep 17 00:00:00 2001 From: zhangruifang2020 Date: Thu, 20 Oct 2022 15:16:45 +0800 Subject: [PATCH] Fix bug with hash options in check mode --- Fix-bug-with-hash-options-in-check-mode.patch | 26 +++++++++++++++++++ rhash.spec | 8 +++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 Fix-bug-with-hash-options-in-check-mode.patch diff --git a/Fix-bug-with-hash-options-in-check-mode.patch b/Fix-bug-with-hash-options-in-check-mode.patch new file mode 100644 index 0000000..4c7e770 --- /dev/null +++ b/Fix-bug-with-hash-options-in-check-mode.patch @@ -0,0 +1,26 @@ +From 79a1a0b3d267893c40ac31192b20e20969a3a79c Mon Sep 17 00:00:00 2001 +From: Aleksey +Date: Sun, 12 Dec 2021 16:27:55 +0300 +Subject: [PATCH] Fix bug with hash options in --check mode + +--- + hash_check.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/hash_check.c b/hash_check.c +index 4cffdc6..4d44d0d 100644 +--- a/hash_check.c ++++ b/hash_check.c +@@ -1262,7 +1262,8 @@ static void set_parser_flags_by_file_extension(struct hash_parser_ext* parser) + struct file_ext ext; + if (!extract_uppercase_file_ext(&ext, parser->hash_file)) + return; +- parser->expected_hash_mask = bsd_hash_name_to_id(ext.buffer, ext.length); ++ if (!parser->expected_hash_mask) ++ parser->expected_hash_mask = bsd_hash_name_to_id(ext.buffer, ext.length); + if (ext.length == 3 && memcmp(ext.buffer, "SFV", 3) == 0) + parser->is_sfv = 1; + } +-- +2.27.0 + diff --git a/rhash.spec b/rhash.spec index 1a11510..6609a5d 100644 --- a/rhash.spec +++ b/rhash.spec @@ -1,11 +1,14 @@ Name: rhash Version: 1.4.2 -Release: 1 +Release: 2 Summary: Great utility for computing hash sums License: MIT URL: https://github.com/rhash/RHash Source0: https://github.com/rhash/RHash/archive/v%{version}/rhash-%{version}.tar.gz +#References: https://github.com/rhash/RHash/commit/79a1a0b3d267893c40ac31192b20e20969a3a79c +Patch0: Fix-bug-with-hash-options-in-check-mode.patch + BuildRequires: gcc %description @@ -63,6 +66,9 @@ make test-shared %{_mandir}/man1/*.1* %changelog +* Fri Oct 21 2022 zhangruifang - 1.4.2-2 +- Fix bug with hash options in check mode + * Tue Nov 30 2021 zoulin - 1.4.2-1 - Upgrade to 1.4.2