Package: mc
Version: 3:4.8.18-1
Severity: normal
Tags: upstream patch
Dear Maintainer,
When compressing file from menu (F2)->y (Gzip or gunzip current file),
there are message
gzip: No such file or directory
This is due to inadequate shell quoting in menu:
=== cut /etc/mc/mc.menu ===
y Gzip or gunzip current file
unset DECOMP
case %f in
*.gz|*.[zZ]) DECOMP=-d;;
esac
gzip "$DECOMP" -v %f
#------------^-------^
+ t t
=== cut ===
When file is not compressed and DECOMP is empty, it should be replaced
by *nothing*, not an empty argument.
This is regression from jessie (it was correct back then).
Patch attached.
Note: version edited, I use self-backported 3:4.8.18-1 on jessie.
-- System Information:
Debian Release: 8.8
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable'), (100,
'proposed-updates')
Architecture: i386 (x86_64)
Foreign Architectures: amd64
Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages mc depends on:
ii libc6 2.19-18+deb8u9
ii libglib2.0-0 2.42.1-1+b1
ii libgpm2 1.20.4-6.1+b2
ii libslang2 2.3.0-2
ii libssh2-1 1.4.3-4.1+deb8u1
ii mc-data 3:4.8.18-1
Versions of packages mc recommends:
ii mime-support 3.58
ii perl 5.20.2-3+deb8u6
ii unzip 6.0-16+deb8u3
Versions of packages mc suggests:
pn arj <none>
ii bzip2 1.0.6-7+b3
pn dbview <none>
ii djvulibre-bin 3.5.25.4-4+b1
ii evince-gtk [pdf-viewer] 3.14.1-2+deb8u1
ii file 1:5.22+15-2+deb8u3
ii genisoimage 9:1.1.11-3
ii gv [pdf-viewer] 1:3.7.4-1
ii imagemagick 8:6.8.9.9-5+deb8u9
pn libaspell-dev <none>
ii mupdf [pdf-viewer] 1.5-1+deb8u2
ii odt2txt 0.4+git20140608-1
ii poppler-utils 0.26.5-2+deb8u1
ii python 2.7.9-1
pn python-boto <none>
pn python-tz <none>
ii texlive-binaries 2014.20140926.35254-6
ii w3m 0.5.3-19+deb8u1
ii xpdf [pdf-viewer] 3.03-17+b1
ii zip 3.0-8
-- no debconf information
-- debsums errors found:
debsums: changed file /usr/lib/mc/ext.d/archive.sh (from mc package)
debsums: changed file /usr/lib/mc/ext.d/image.sh (from mc package)
debsums: changed file /usr/lib/mc/ext.d/misc.sh (from mc package)
debsums: changed file /usr/lib/mc/extfs.d/urar (from mc package)
Index: mc-4.8.18/misc/mc.menu.in
===================================================================
--- mc-4.8.18.orig/misc/mc.menu.in
+++ mc-4.8.18/misc/mc.menu.in
@@ -241,7 +241,8 @@ y Gzip or gunzip current file
case %f in
*.gz|*.[zZ]) DECOMP=-d;;
esac
- gzip "$DECOMP" -v %f
+ # do *not* add quotes around $DECOMP!
+ gzip $DECOMP -v %f
+ t t
Y Gzip or gunzip tagged files
@@ -250,7 +251,7 @@ Y Gzip or gunzip tagged files
case "$i" in
*.gz|*.[zZ]) DECOMP=-d;;
esac
- gzip "$DECOMP" -v "$i"
+ gzip $DECOMP -v "$i"
done
+ ! t t
@@ -259,7 +260,7 @@ b Bzip2 or bunzip2 current file
case %f in
*.bz2) DECOMP=-d;;
esac
- bzip2 "$DECOMP" -v %f
+ bzip2 $DECOMP -v %f
+ t t
B Bzip2 or bunzip2 tagged files
@@ -268,7 +269,7 @@ B Bzip2 or bunzip2 tagged files
case "$i" in
*.bz2) DECOMP=-d;;
esac
- bzip2 "$DECOMP" -v "$i"
+ bzip2 $DECOMP -v "$i"
done
+ f \.tar.gz$ | f \.tgz$ | f \.tpz$ | f \.tar.Z$ | f \.tar.z$ | f \.tar.bz2$ | f \.tar.F$ & t r & ! t t