Package: mhonarc
Version: 2.6.19-2
Severity: normal
Tags: patch upstream

Dear Maintainer,

When ‘-gzipfiles’ [0] is set, MHonArc generates a temporary file on
which to call gzip(1) afterwards.  The template doesn't include a suffix
so there is no guaranty that the filename won't end with ‘.gz’, ‘-gz’,
‘.z’, ‘-z’ or ‘_z’ (ignoring case).  Stumbling upon such a filename is
not that seldom on large archive, and cause gzip(1) to fail with

    already has .gz suffix -- unchanged

(Setting ‘-fasttempfiles’ doesn't appear to help.)  The fix is trivial:
call `gzip -f` instead in order to avoid the suffix sanity check.  (For
Debian `gzip -f` isn't a problem, but I'm not sure how common that flag
is on other systems.  In doubt one may want to dump the file into
`gzip`'s standard input instead.)

Cheers,
-- 
Guilhem.

[0] https://www.mhonarc.org/MHonArc/doc/resources/gzipfiles.html
--- a/mhonarc-2.6.19/lib/mhfile.pl	2010-12-31 22:20:41.000000000 +0100
+++ b/mhonarc-2.6.19/lib/mhfile.pl	2020-09-13 00:52:32.677416587 +0200
@@ -98,7 +98,7 @@
 sub file_gzip {
     my $file = shift;
     return  if ($file =~ /\.gz$/i);
-    if (system($GzipExe, $file) != 0) {
+    if (system($GzipExe, '-f', '--', $file) != 0) {
 	die qq/ERROR: Failed to exec "$GzipExe $file": $! $?\n/;
     }
 }

Attachment: signature.asc
Description: PGP signature

Reply via email to