[NTG-pdftex] Re: Patch ShellEscape

Heiko Oberdiek oberdiek@uni-freiburg.de
Fri, 11 Jul 2003 13:42:05 +0200


On Fri, Jul 11, 2003 at 01:08:47PM +0200, Martin Schroeder wrote:

> On 2003-07-11 01:37:20 +0200, Heiko Oberdiek wrote:
> > Patch ShellEscapeIfeof18
> 
> Sounds good.

A short discussion about the two methods \shellescape vs. \ifeof18:

* \ifeof18: the temptation for enabling the \write18 feature at
  macro level, because this interface only provides asking/reading
  and not writing. For security reasons the \write18 feature
  must not be enabled at macro level.
* The implementation is easier and more portable,
  because there is no need for the nasty magic *_code number of
  a new primitive that would also affect change files of other
  TeX enginges.
* \ifeof18 avoids a new primitive. The "namespace" problem, however,
  could be solved by funny names, eg.: "\.web2c.shellescape".
* But there is also a disadvantage of the \ifeof18 method:
  TeX generates a error message, if \ifeof18 is not supported.
  Unhappily TeX does not provide an exception mechanism, so this
  error cannot be catched.
    For "tex" and "etex" I see no way to avoid this without a new
  primitive that can easily checked for existence. The primitive
  can be either a command that indicates the presence of the
  feature or returns the version number of web2c.
    For "pdf(e)tex" this is not a problem, because here
  \pdfversion and \pdfrevision can be asked. So packages such
  as pdftricks, pdftex.def, ... will be happy.

Yours sincerely
  Heiko <oberdiek@uni-freiburg.de>
--