Skip to main content.
home | support | download

Back to List Archive

Re: filenames with ' don't work

From: Bill Moseley <moseley(at)>
Date: Mon May 09 2005 - 19:42:36 GMT
On Mon, May 09, 2005 at 11:52:05AM -0700, Nick wrote:
> Filenames that have ' in them are not working with FileFilter.
> It looks like FileFilter actually calls the shell to call a program
> instead of exec'ing it itself, which seems like a bad idea to me:

Yes, it's bad.  It uses popen() which passes the file name through the
shell.  This has been discussed before.  One idea would be to make a
copy of the file before calling the filter.  Another would be a
bi-directional pipe -- but again, that's likely not that portable.

I was complaining last night about how Debian adds quotes to %s in
/etc/mailcap, and mutt also adds quotes so you end up with double
quotes and no protection from the shell (well, mutt does try and
sanitize file names in some cases).

I would recommend using instead for filtering, since it
uses the SWISH::Filter module for filtering.  SWISH::Filter uses
fork/exec (except on Windows, of course) to run the program so you
should not have that problem.  The exception would be if an individual
filter runs a program.

Bill Moseley

Unsubscribe from or help with the swish-e list:

Help with Swish-e:
Received on Mon May 9 12:42:37 2005