!15 Fix bug with hash options in check mode

From: @zhangruifang2020 
Reviewed-by: @small_leek 
Signed-off-by: @small_leek
This commit is contained in:
openeuler-ci-bot 2022-10-25 08:44:24 +00:00 committed by Gitee
commit ddbf825f40
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,26 @@
From 79a1a0b3d267893c40ac31192b20e20969a3a79c Mon Sep 17 00:00:00 2001
From: Aleksey <rhash.admin@gmail.com>
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

View File

@ -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 <zhangruifang1@h-partners.com> - 1.4.2-2
- Fix bug with hash options in check mode
* Tue Nov 30 2021 zoulin <zoulin13@huawei.com> - 1.4.2-1
- Upgrade to 1.4.2