Package: mime-support
Version: 3.54
Severity: important

When update-mime converts desktop entries from /usr/share/applications into 
mailcap entries, it does not properly quote arguments. I ran into this problem 
when trying to display an image with a space in its filename using run-mailcap. 
I have imagemagick installed, so the relevant mailcap entries, in the 
repeatable order generated by update-mime, are:

image/jpeg; /usr/bin/display.im6 %s; test=test -n "$DISPLAY"
image/jpeg; display.im6 'jpeg:%s'; test=test -n "$DISPLAY"

The first entry, which is what ends up being used as it's listed first, fails 
with a typical "file not found" error with a path truncated at the location of 
the first space, as the mailcap entry needs to quote the "%s" portion of the 
commands to ensure that space-containing filenames are passed as a single 
argument. The second entry succeeds because the "%s" is quoted. The first entry 
is converted from the Exec line in /usr/share/applications/display.im6.desktop, 
"Exec=/usr/bin/display.im6 %f". The second entry is obtained from 
/usr/lib/mime/packages/imagemagick. After installing mirage, I now have another 
mailcap entry converted from a desktop entry, and it has exactly the same 
error, so this is not specific to imagemagick. ("Exec=mirage %f" is converted 
to "image/jpeg; mirage %s; test=test -n "$DISPLAY"")

I am not familiar enough with Perl to provide a patch, but I can tell where 
this is happening in update-mime, and it seems like an easy fix for someone 
confident in their Perl ability. I believe the relevant lines are under "sub 
ReadDesktopEntries", in the block beginning "elsif (m/Exec=(.*)$/i) {".


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (800, 'testing'), (700, 'unstable'), (600, 'stable'), (500, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

mime-support depends on no packages.

Versions of packages mime-support recommends:
ii  file  1:5.14-2

mime-support suggests no packages.

-- no debconf information

-- 
Joseph Spiros
jos...@josephspiros.com
+1 (440) 707-6855


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to