Hello,

> The name alias occurs because said file has shell meta characters in it, 
> specifically, the "&".  Since according to the RFC, all commands from 
> the mailcap file are to be passed to /bin/sh, including shell 
> meta-characters in the filename can cause problems.
> 
> Imagine trying to open a file named such:
> 
>       picture; rm -rf / .jpg

btw, filenames cannot contain slashes, at least on systems where slashes are
used as pathname separators :)

> You would end up trying to erase every file on your system.  Thus, 
> mime-support creates an alias for any files with such characters.
> 
> The first thought of an alternative would be to simply escape the 
> meta-characters so the shell doesn't try to interpret them. 
> Unfortunately, the RFC did not address this issue but did state that the 
> command must be run exactly as-is with the needed substitutions. Thus, 
> quoting meta-characters may not work in all cases
> 
>       image/jpeg: xv "%f"             would be okay
> but   image/jpeg: xv '%f'             would be wrong
> 
> In the latter case, the "\" quoting would be considered part of the 
> filename and said file would not be found.
> 
> Sorry, but there is no easy (or hard, for that matter) fix for this. 
> Best if you don't include such characters in your filenames.

I've looked at this problem and it looks that if '%s' is provided within the
mailcap file, the filename won't get substitued even if containg
metacharacters. That's probably why all of records in my current mailcap
call '%s' instead of "%s" which would be imho a bug in them, not in
run-mailcap.

I think that run-mailcap could check if the filename is provided as '%s' and
if so, not to use temporary name but provide the filename directly.

.. It's not always possible not to use filenames, especially when accessing
remore read-only filesystems :)


-- 
Matus UHLAR - fantomas, [EMAIL PROTECTED] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Microsoft dick is soft to do no harm


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to