Add patch to fix 'fread returns element count, not element size'

Signed-off-by: Björn Esser <besser82@fedoraproject.org>
This commit is contained in:
Björn Esser 2021-07-14 16:52:12 +02:00
parent fbe143d1bd
commit 0d2b677f8f
No known key found for this signature in database
GPG Key ID: F52E98007594C21D
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From ffd35d89021a9b8375a9246082afc6fc270a93ee Mon Sep 17 00:00:00 2001
From: steven Y Gui <guiyao@huawei.com>
Date: Wed, 14 Jul 2021 16:17:48 +0800
Subject: [PATCH] fread returns element count, not element size
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
---
libmisc/salt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libmisc/salt.c b/libmisc/salt.c
index 9fd34332..91d528fd 100644
--- a/libmisc/salt.c
+++ b/libmisc/salt.c
@@ -168,7 +168,7 @@ static long read_random_bytes (void)
#else
FILE *f = fopen ("/dev/urandom", "r");
- if (fread (&randval, sizeof (randval), 1, f) != sizeof (randval)) {
+ if (fread (&randval, sizeof (randval), 1, f) != 1) {
fclose(f);
goto fail;
}
--
2.31.1

View File

@ -1,7 +1,7 @@
Summary: Utilities for managing accounts and shadow password files
Name: shadow-utils
Version: 4.8.1
Release: 18%{?dist}
Release: 19%{?dist}
Epoch: 2
URL: https://github.com/shadow-maint/shadow
Source0: https://github.com/shadow-maint/shadow/releases/download/%{version}/shadow-%{version}.tar.xz
@ -120,6 +120,8 @@ Patch65: shadow-4.8.1-useradd_create_relative_home_path_correctly.patch
Patch66: shadow-4.8.1-getentropy_random_bytes.patch
# https://github.com/shadow-maint/shadow/commit/ea04eb301d08c0c58f1120f87d4ec184d3983ce5
Patch67: shadow-4.8.1-crypt_gensalt.patch
# https://github.com/shadow-maint/shadow/commit/ffd35d89021a9b8375a9246082afc6fc270a93ee
Patch68: shadow-4.8.1-salt_c_fix_fread.patch
License: BSD and GPLv2+
BuildRequires: make
@ -212,6 +214,7 @@ Development files for shadow-utils-subid.
%patch65 -p1 -b .useradd_create_relative_home_path_correctly
%patch66 -p1 -b .getentropy_random_bytes
%patch67 -p1 -b .crypt_gensalt
%patch68 -p1 -b .fix_fread
iconv -f ISO88591 -t utf-8 doc/HOWTO > doc/HOWTO.utf8
cp -f doc/HOWTO.utf8 doc/HOWTO
@ -382,6 +385,9 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/libsubid.la
%{_libdir}/libsubid.so
%changelog
* Wed Jul 14 2021 Björn Esser <besser82@fedoraproject.org> - 2:4.8.1-19
- Add patch to fix 'fread returns element count, not element size'
* Wed Jul 14 2021 Iker Pedrosa <ipedrosa@redhat.com> - 2:4.8.1-18
- Fix regression issues detected in rhbz#667593 and rhbz#672510