viewing attachments fails when filenames have spaces

Bug #676691 reported by Christopher League
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flim (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: flim

I encountered a problem opening (playing) attachments in an external program, when the designated file name contained spaces. I traced this to an issue of double-quoting. In my /etc/mailcap on Ubuntu 10.04, it says something like

    application/pdf; evince '%s'

Because of those single quotes, it is incorrect to quote the spaces in the filename. However, mime-format-mailcap-command calls shell-quote-argument anyway, so it ends up trying to run

    evince '/tmp/blahblah/My\ Silly\ Proposal.pdf'

And so evince opens up but says "File cannot be opened" because it's looking for a file with literal backslashes in the name.

Probably, removing shell-quote-argument is not the best behavior, because it is dependent on how the commands in mailcap are written. So instead, I have this small patch that looks for quotes in the mailcap command, and if %s is inside quotes, then it does not invoke shell-quote-argument before substituting. This workaround seems to work for me, though I'd appreciate confirmation of the bug and the fix from others.

Best wishes,
Chris

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: flim 1:1.14.9-4.1
ProcVersionSignature: Ubuntu 2.6.32-25.45-generic 2.6.32.21+drm33.7
Uname: Linux 2.6.32-25-generic i686
Architecture: i386
Date: Wed Nov 17 15:46:23 2010
Dependencies: apel 10.7-3
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.utf8
 SHELL=/bin/zsh
SourcePackage: flim

Revision history for this message
Christopher League (league) wrote :
Revision history for this message
Tatsuya Kinoshita (tats-debian) wrote :

Fixed in Debian.

     flim (1:1.14.9+0.20120428-9) unstable; urgency=medium
     .
       * Sync 010_flim-1_14-wl.patch on 2014-09-15
         - Workaround to handle '%s' in /etc/mailcap (closes: #572993)

cf.
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572993
    https://github.com/wanderlust/flim/pull/3

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "mime-conf.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Tatsuya Kinoshita (tats-debian) wrote :

Fixed in Ubuntu 15.04.

Changed in flim (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.