Summary: | Regression? with doxygen generated .ps files. | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | ghostscript |
Component: | General | Assignee: | Chris Liddell (chrisl) <chris.liddell> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | chris.liddell, manik.cr24, robin.watts |
Priority: | P4 | ||
Version: | 9.50 | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- | |
Attachments: |
The generated ps file
_form0.eps |
Description
ghostscript
2019-11-11 17:56:36 UTC
Created attachment 18524 [details]
_form0.eps
(In reply to ghostscript from comment #0) > I'm terrible sorry if this is not the place to post this, but I have a bit > of a trouble to find the right place. This is a perfectly reasonable place. Another place would be the irc channel #ghostscript, where we might solve the problem with a bit of back and forth faster than doing via bugzilla, but this is OK. > After a recent system upgrade I couldn't build any doxygen generated user > documentation that included formulas. (ghostscript upgrade from 9.27-2 to > 9.50) The big change for 9.50 is the file security modifications. This basically adds additional controls onto what files gs can read and write. > Error: /undefinedfilename in (_form0.ps) > Operand stack: > > Execution stack: > %interp_exit .runexec2 --nostringval-- --nostringval-- > --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- > --nostringval-- false 1 %stopped_push > Dictionary stack: > --dict:730/1123(ro)(G)-- --dict:0/20(G)-- --dict:76/200(L)-- > Current allocation mode is local > Last OS error: Permission denied > GPL Ghostscript 9.50: Unrecoverable error, exit code 1 > error: Problem running ghostscript gs -q -g178x66 -r384x384x -sDEVICE=ppmraw > -sOutputFile=_form0.pnm -dNOPAUSE -dBATCH -- _form0.ps. Check your > installation! > Generating index page... OK. So that looks to me like it can't find the "_form0.ps" file. That might be because such a file doesn't exist, or it might be because we are not permitted to READ from such a file. > So I tried the mentioned command in the error output and got > > ``` > gs -q -g178x66 -r384x384x -sDEVICE=ppmraw -sOutputFile=_form0.pnm -dNOPAUSE > -dBATCH -- _form0.ps > Error: /undefinedfilename in (_form0.ps) > Operand stack: > > Execution stack: > %interp_exit .runexec2 --nostringval-- --nostringval-- > --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- > --nostringval-- false 1 %stopped_push > Dictionary stack: > --dict:730/1123(ro)(G)-- --dict:0/20(G)-- --dict:76/200(L)-- > Current allocation mode is local > Last OS error: Permission denied > GPL Ghostscript 9.50: Unrecoverable error, exit code 1 > ``` First off, check to see if _form0.ps exists. If it doesn't, there's your problem. If it does, try using: gs --permit-file-read=_form0.ps -q -g178x66 -r384x384x -sDEVICE=ppmraw -sOutputFile=_form0.pnm -dNOPAUSE -dBATCH -- _form0.ps and see if that solves the problem. If it does, then adding that path onto the list of paths allowed to be read should solve it. (In reply to Robin Watts from comment #2) > > Error: /undefinedfilename in (_form0.ps) > > Operand stack: > > > > Execution stack: > > %interp_exit .runexec2 --nostringval-- --nostringval-- > > --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- > > --nostringval-- false 1 %stopped_push > > Dictionary stack: > > --dict:730/1123(ro)(G)-- --dict:0/20(G)-- --dict:76/200(L)-- > > Current allocation mode is local > > Last OS error: Permission denied > > GPL Ghostscript 9.50: Unrecoverable error, exit code 1 > > error: Problem running ghostscript gs -q -g178x66 -r384x384x -sDEVICE=ppmraw > > -sOutputFile=_form0.pnm -dNOPAUSE -dBATCH -- _form0.ps. Check your > > installation! > > Generating index page... > > OK. So that looks to me like it can't find the "_form0.ps" file. That's what undefinedfilename means, yes. > > gs -q -g178x66 -r384x384x -sDEVICE=ppmraw -sOutputFile=_form0.pnm -dNOPAUSE > > -dBATCH -- _form0.ps > > Error: /undefinedfilename in (_form0.ps) > > Operand stack: > > > > Execution stack: > > %interp_exit .runexec2 --nostringval-- --nostringval-- > > --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- > > --nostringval-- false 1 %stopped_push > > Dictionary stack: > > --dict:730/1123(ro)(G)-- --dict:0/20(G)-- --dict:76/200(L)-- > > Current allocation mode is local > > Last OS error: Permission denied > > GPL Ghostscript 9.50: Unrecoverable error, exit code 1 > > ``` > > First off, check to see if _form0.ps exists. If it doesn't, there's your > problem. The problem appears to be the use of '--'. If you remove that then _fomr0.ps will be found and will run. Of course it will then immediately fail with an invalidaccess error on _form0.eps because that file is not able to be read (permission has not been granted). It looks like the '--'switch has been broken, but I have no idea why you are using it anyway in this setup, its not doing anything. Leave it off and I believe _form0.ps will be found as expected. Which will then get you into the security issues Robin mentioned. _fomr0.ps executes the run operator on '_form0.eps'. Since PostScript is a programming language, that means its going to execute a file whose contents are unknown. With the release of 9.50 if you want to do that you need to explicitly tell Ghostscript you want to do so. If I can make a tiny modification to Robin's suggestion: gs --permit-file-read=_form0.eps -q -g178x66 -r384x384x -sDEVICE=ppmraw -sOutputFile=_form0.pnm -dNOPAUSE -dBATCH _form0.ps That allows form0.eps to be run, and removes the '--' switch which you don't need. Give that a whirl and I think it will work Sort of fixed in: http://git.ghostscript.com/?p=user/chrisl/ghostpdl.git;a=commitdiff;h=24ec06a27df6 That commit fixes the "primary" file argument, that is, the file name that immediately follows "--". We cannot fix the other problem (that _form0.ps does "( _form0.eps) run" in the Postscript). Security concerns mean allowing Postscript jobs to open/read/run/etc arbitrary other files is just not feasible. For instances like this, as discussed on IRC ( https://ghostscript.com/irclogs/2019/11/11.html ) there really is not option but the use the file access permissions options: file:///home/cliddell/artifex/ghostpdl/doc/Use.htm#Safer Disabling SAFER ( -dNOSAFER ) would also work, but is something we would strongly discourage as a security hazard. *** Bug 701988 has been marked as a duplicate of this bug. *** |