Created attachment 18764 [details] The example case When using ps2epsi with the 9.50 distribution: ps2epsi _form0_tmp.ps _form0.eps we get the error: Error: /undefined in getenv Operand stack: (outfile) Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1990 1 4 %oparray_pop 1989 1 4 %oparray_pop 1977 1 4 %oparray_pop 1833 1 4 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- Dictionary stack: --dict:731/1123(ro)(G)-- --dict:0/20(G)-- --dict:76/200(L)-- --dict:5/30(L)-- --dict:11/30(L)-- Current allocation mode is local Current file position is 8386 GPL Ghostscript 9.50: Unrecoverable error, exit code 1 When adding the -dNOSAFER to the ps2epsi script at the second call of the GS_EXECUTABLE the problem is gone and the program functions as wanted. It is clear that it is not a good option to add the -dNOSAFER by default in ps2epsi script, but it would be useful to: - have an option to overcome the problem when calling ps2epsi - have another solution I've attached the complete case of commands that we used to reproduce this problem. The problem has been reported for arch linux and for Macports on OSX 10.14.6 Originally mentioned in: - https://github.com/doxygen/doxygen/issues/7484 Possible references to similar / related problems: - https://bugs.ghostscript.com/show_bug.cgi?id=230699 - https://bugs.ghostscript.com/show_bug.cgi?id=699744 - https://bugs.ghostscript.com/show_bug.cgi?id=701894
The attached .zip file does not contain _form0_tmp.ps It does contain _form0.ps which is a file that does some trivial PostScript, then ends with: (_form1.eps) run Running a file would be prohibited by 9.50 unless -dNOSAFER or -P is used (-P adds the cwd to the allowed search path, as documented is Use.htm) Ignoring the bug as reported, I note that I can reproduce the problem with: lib/ps2epsi examples/colorcir.ps colorcir.eps The basic problem is that ps2epsi script AND ps2epsi.ps need to be re-done to be compatible with 9.50 more aggressive SAFER mode. Note that even if 'getenv' is not undefined, it would still fail because the outfile would (probably) not be on a path that was permitted for writing or reading in SAFER mode. As a work around, the lib/eps2eps script (which uses the newer, better eps2write device) _is_ compatible and works. Despite the name, it accepts general PostScript and is not restricted to EPS input file types.
The "missing" _form0_tmp.ps is indeed not in the attachment, it will be generated by means of the commands as defined in the cmds file. I explicitly didn't include it possible to generate it, by means of: - latex _formulas.tex - dvips -q -D 600 -n 1 -p 1 -o _form0_tmp.ps _formulas.dvi I'll attach the file as well.
Created attachment 18765 [details] The"missing _form0_tmp.ps
In your reply you wr0te: "the lib/eps2eps script (which uses the newer, better eps2write device) _is_ compatible and works" since which version is this available?
Created attachment 18766 [details] form0.eps Output from: eps2eps _form0_tmp.ps form0.eps (to validate the workaround for this task)
eps2write was added by: commit ee4458671553d95302439bacbbb66333d019b83a Author: Chris Liddell <chris.liddell@artifex.com> Date: Wed Mar 26 07:34:18 2014 +0000 Add eps2write to Linux gs and all ghostpdl bulids The eps2eps script was changed to use this by: commit 94786ac00b285be997aaddbc689180478a47e270 Author: Chris Liddell <chris.liddell@artifex.com> Date: Fri Sep 12 14:49:08 2014 +0100 Get rid of last vestiges of pswrite.... Remove epswrite (the final "subdevice" of pswrite) and references to it. Also remove the gdevps.c source file. Unfortunately, we missed the ps2epsi script.
Thanks I tested it already local with an old version of ghostscript and this looks OK. I asked the submitter / commenter on the doxygen issue to test the work around as well (no answer yet). So far all results look positive. Just out of curiosity, will the ps2epsi script be updated as well?
Looks like te eps2eps has also some regression, see https://bugs.ghostscript.com/show_bug.cgi?id=702110
Re-write of ps2epsi.ps and simplify ps2epsi linux script fixes this. Now windows and linux produce equivalent output. Commit 7c96228899ea05b40cdb31dc5a4c3f61aa0d39e6 It was a close call between just removing this script and fixing it. At least it now uses the modern eps2write and resolves issues if the input had more than a single page (EPSF files should not).