From 095a43f7a245144944d1762b72c95ca8253c4def Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 08 2022 07:02:25 +0000 Subject: import file-5.33-21.el8 --- diff --git a/SOURCES/file-5.33-fix-compression.patch b/SOURCES/file-5.33-fix-compression.patch new file mode 100644 index 0000000..adbd7c5 --- /dev/null +++ b/SOURCES/file-5.33-fix-compression.patch @@ -0,0 +1,42 @@ +diff --git a/src/compress.c b/src/compress.c +index cb11303..5677412 100644 +--- a/src/compress.c ++++ b/src/compress.c +@@ -723,25 +723,24 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, const unsigned char *old, + rv = OKDATA; + if ((r = sread(fdp[STDOUT_FILENO][0], *newch, bytes_max, 0)) > 0) + break; +- DPRINTF("Read stdout failed %d (%s)\n", fdp[STDOUT_FILENO][0], +- r != -1 ? strerror(errno) : "no data"); +- +- rv = ERRDATA; +- if (r == 0 && +- (r = sread(fdp[STDERR_FILENO][0], *newch, bytes_max, 0)) > 0) +- { ++ if (r < 0) { ++ rv = ERRDATA; ++ DPRINTF("Read stdout failed %d (%s)\n", fdp[STDOUT_FILENO][0], ++ strerror(errno)); ++ goto err; ++ } else if ((r = sread(fdp[STDERR_FILENO][0], *newch, bytes_max, 0)) > 0){ ++ rv = ERRDATA; + r = filter_error(*newch, r); + break; + } +- free(*newch); + if (r == 0) +- rv = makeerror(newch, n, "Read failed, %s", +- strerror(errno)); +- else +- rv = makeerror(newch, n, "No data"); ++ break; ++ free(*newch); ++ rv = ERRDATA; ++ rv = makeerror(newch, n, "Read stderr failed, %s", ++ strerror(errno)); + goto err; + } +- + *n = r; + /* NUL terminate, as every buffer is handled here. */ + (*newch)[*n] = '\0'; diff --git a/SPECS/file.spec b/SPECS/file.spec index c732f22..9c984c6 100644 --- a/SPECS/file.spec +++ b/SPECS/file.spec @@ -15,7 +15,7 @@ Summary: A utility for determining file types Name: file Version: 5.33 -Release: 20%{?dist} +Release: 21%{?dist} License: BSD Group: Applications/File Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz @@ -85,6 +85,9 @@ Patch21: file-5.33-other-languages.patch # fix heap-based buffer overflow in cdf_read_property_info() (CVE-2019-18218) Patch22: file-5.37-CVE-2019-18218.patch +# not yet upstream (#2095828) +Patch23: file-5.33-fix-compression.patch + URL: http://www.darwinsys.com/file/ Requires: file-libs = %{version}-%{release} BuildRequires: zlib-devel @@ -255,6 +258,9 @@ cd %{py3dir} %endif %changelog +* Wed Aug 17 2022 Vincent Mihalkovic - 5.33-21 +- fix recognition (src/compress.c) of compressed empty files (#2095828) + * Tue May 04 2021 Vincent Mihalkovic - 5.33-20 - rebuild (#1954434)