Desktop Specification 0.9.4
gus at inodes.org
Fri Jul 11 12:35:43 EEST 2003
At Wed, 9 Jul 2003 14:39:46 +0200 (CEST), Koblinger Egmont wrote:
> - My biggest headache, the exact interpretation of Exec's value is still
> open, I think it should be addressed for 0.9.5 or 0.9.6. Now I understand
> that the system() call (or something similar, e.g. sh -c) is used but
> taking care to properly escape filenames. However as it highly depends on
> in which contect the given exec parameter appears, a trivial variant of
> the shell's parsing has to be duplicated.
As I mentioned in the middle of a mailcap/shared-mime-spec discussion,
the only robust and still simple way to handle this is to shell-escape
the filename before substituting into the command line. The Exec line
should not attempt to do its own quoting around replaced strings.
Its then up to the Exec line writer to not do anything really exotic
at the point the substitution occurs (replacing it with alternate
shell syntax if required).
The mutt docs have a reasonable description of the issues and the
solution (as applied to mailcap command lines) - I'm offline atm so I
can't find a direct link. This also gives examples of the "exotic"
and "alternate shell syntax" cases mentioned above.
More information about the xdg