diff --git a/dist b/dist new file mode 100644 index 0000000000000000000000000000000000000000..9c0e36ec42a2d9bfefacb21ac6354c9ddd910533 --- /dev/null +++ b/dist @@ -0,0 +1 @@ +an8 diff --git a/download b/download new file mode 100644 index 0000000000000000000000000000000000000000..7616f2a6633c6417d5bea99846e3fea50171e90b --- /dev/null +++ b/download @@ -0,0 +1 @@ +bbe6db96e3a9ca9554dce647390540ef file-5.33.tar.gz diff --git a/file-5.33-fix-compression.patch b/file-5.33-fix-compression.patch new file mode 100644 index 0000000000000000000000000000000000000000..adbd7c59d9006b4d8ea383bb62f83ec3dc9130bb --- /dev/null +++ b/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/file-5.33.tar.gz b/file-5.33.tar.gz deleted file mode 100644 index a2c9bbb02037abedd33d00dc86ee1915afc8b94d..0000000000000000000000000000000000000000 Binary files a/file-5.33.tar.gz and /dev/null differ diff --git a/file.spec b/file.spec index c732f22f4e2cb5544a1c5aa045d2f5306215f5b1..9c984c6167d4dfa47ded3b30dac2358e16761f59 100644 --- a/file.spec +++ b/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)