Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2022/05/31)Fwd 1 day (to 2022/06/02) >>>20220601 
artifexirc-bot <JoergEwald> Hello everybody. I was tasked to update a few tools that were last touched in 2013. These tools use, amongst other things, Ghostscript 9.07, and a Postscript program called tif2eps.ps (available from here: https://sourceforge.net/projects/tif2eps/postdownload) to convert TIFF files to Postscript. 12:40.33 
  <JoergEwald> 12:40.34 
  <JoergEwald> Using tif2eps.ps with Ghostscript 9.56.1 fails. I managed to fix the first problem ("/undefined in shellarguments") by renaming shellarguments to .shellarguments. But somehow the provided input and output file names still do not seem to make it into the system, now I get "Input file not found, quitting". I guess the dictionary reference used in tif2eps.ps (EPSdict /InputFilename) is no longer valid? 12:40.35 
  <JoergEwald> 12:40.36 
  <JoergEwald> First off, am I maybe on the completely wrong path here, and converting TIFFs to Postscript can be done directly within Ghostscript by now? If not, then it's probably time to make tif2eps.ps compatible with 9.56.1 - how do I reference input and output file names and parameters now?12:40.38 
  <KenSharp> Ghostscript doesn't read TIFF files directly. I think GhostPDL will (it can read a number of image formats). However I'm pretty certain that tiff2eps will be using code written by me.12:42.02 
  <KenSharp> The most likely problem (it'll take me some minutes to try this) is that since the relase of 9.07 a number of things have changed. In particular the security model.12:42.38 
  <KenSharp> SAFER is now the default, which means that PostScript programs are not permitted to read arbitrary files, you must give the interpreter permission to read them. I would bet that tiff2eps opens the TIFF file on disk.12:43.35 
  <KenSharp> But it will be a few minutes while I get teh program and look at it12:43.48 
  <KenSharp> OK so it's a batch file and a PostScript program12:45.01 
  <JoergEwald> We don't use the batch file, but run the whole thing from a bash script. The line in question can be simplified to: >gs -dNODISPLAY -q -- ./tif2eps.ps frame.tif frame.eps -m112:46.28 
  <KenSharp> Well it's not the program I wrote, though it is (unsurprisingly) similar12:47.09 
  <JoergEwald> 🙂12:47.17 
  <KenSharp> Basically it looks like the PostScript program has bitrotted12:48.38 
  <JoergEwald> My impression as well. The question is, can the rot be undone with reasonable effort, or do we tell our client to stick with Ghostscript 9.07?12:49.37 
  <KenSharp> Ghostscript 9.07 has some significant, well publicised secuirty vulnerabilities12:50.16 
  <JoergEwald> I was afraid so12:50.24 
  <KenSharp> Nothing that would be affected by this, but its a hole in the system12:50.31 
  <KenSharp> Changing shellarguments to .shellarguments works for me, in as much as I get the expected invalidfileaccess12:51.23 
  <KenSharp> Adding --permit-file-read=<fully qualified input filename> --permit-file-write=<fully qualified output filename> works completely12:52.37 
  <JoergEwald> OK. Wow, that's easy then!12:52.53 
  <KenSharp> As I suspected, it's basically the change in security model. PostScript programs have to be granted permission specifically to be able to read and write files from disk.12:53.36 
  <KenSharp> The inpu t file is granted read permission because, well, obviouslu you need to12:53.54 
  <JoergEwald> Our client works in a very sensitive field, having security holes is not acceptable to them. Being able to upgrade to 9.56 will be a big relief for them.12:55.03 
  <JoergEwald> Thank you so much for your incredibly quick and competent assistance!12:55.29 
  <KenSharp> OK well sa I said, change shellarguments to .shellarguments, and add the permission to read and write the specifically named input and output files and you should be OK12:55.41 
  <KenSharp> You're welcome12:55.49 
 <<<Back 1 day (to 2022/05/31)Forward 1 day (to 2022/06/02)>>> 
ghostscript.com #mupdf
Search: