🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.vm.bug
Article #582

Re: Handling external content attachment names with space

#582
From: Kevin Rodgers
Date: Mon, 10 Oct 2005 19:09
42 lines
3017 bytes
Joachim Schrod wrote:
> newsspam5REMOVETHIS@robf.de wrote:
> > Joachim Schrod <jschrod@acm.org> writes:
> > > My vm-mime-external-content-types-alist has the entry
> > > ("application/pdf" "acroread")
> > >
> > > When an attachment name has spaces in it, acroread is called with
> > > several arguments instead of one. Anybody got a patch already for
> > > that? Then I won't have to look at the issue myself. ;-)
> >
> > Have you Googled?
> >
> > http://groups.google.com/groups?selm=400320B7.5060408%40yahoo.com
> > http://groups.google.com/groups?selm=86hdyoc6n9.fsf%40robf.deREMOVETHIS
>
> Yes, but obviously my search term was not good enough. This thread
> didn't appear on the first two pages. Thanks for the pointers, they
> remedy my problem.
> >
> > > Incidentially, that looks as if the external-content program is
> > > called via a shell. Anybody knows why that is done or if it can be
> > > avoided? That behaviour opens up issues of shell command
> > > insertions which would be more difficult if the program is called
> > > directly.
> >
> > It is called via 'start-process', which IMHO is not the shell.
>
> But then one wouldn't need the quoting that is introduced in the first
> posting you refered to, above. If one just passes the attachment name
> as argument to start-process, it wouldn't be split at white
> space. Anyhow, it works this way; perhaps I'll check for the shell
> call when I have more time.

Read the doc string for vm-mime-external-content-types-alist carefully:
a single string is interpreted as a shell COMMAND-LINE and multiple
strings are interepreted as PROGRAM ARG ARG ...

To prevent the shell from being invoked, change the entry to:
("application/pdf" "acroread" "%f")

-- 
Kevin
Technical Details
Message-ID: <1128971351.526240.163600@o13g2000cwo.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail
References: <3qpr4kFfe6r4U1@individual.net><85k6gn1z82.fsf@robf.de> <3qsj0pFgdv3eU1@individual.net>

Show Full Headers
Complete Article Headers
X-Google-Thread: f6829,2d18889792627219
X-Google-Attributes: gidf6829,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail
From: "Kevin Rodgers" <ihs_4664@yahoo.com>
Newsgroups: gnu.emacs.vm.bug
Subject: Re: Handling external content attachment names with space
Date: 10 Oct 2005 12:09:11 -0700
Organization: http://groups.google.com
Lines: 43
Message-ID: <1128971351.526240.163600@o13g2000cwo.googlegroups.com>
References: <3qpr4kFfe6r4U1@individual.net><85k6gn1z82.fsf@robf.de>
   <3qsj0pFgdv3eU1@individual.net>
NNTP-Posting-Host: 207.167.42.60
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1128971356 1261 127.0.0.1 (10 Oct 2005 19:09:16 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 10 Oct 2005 19:09:16 +0000 (UTC)
In-Reply-To: <3qsj0pFgdv3eU1@individual.net>
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.7.10) Gecko/20050722 Firefox/1.0.6,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: o13g2000cwo.googlegroups.com; posting-host=207.167.42.60;
   posting-account=XMv3kA0AAAAUbJbW6yOqPN908sJK8uyQ