Re: Ghostscript/GhostPDL 9.28 Release Candidate 1

Chris Liddell <[email protected]> Thu, 22 Aug 2019 11:20:39 +0100
Newsgroups gmane.comp.printing.ghostscript.devel
Message-ID <[email protected]>
On 22/08/2019 10:27, Akira Kakuto wrote:
> Dear Chris,
> 
>> As I said before, we almost certainly won't be adopting that kind of
>> solution. As a matter of policy, we avoid platform specific code in
>> non-platform specific source files.
> 
> Of course I understand that. I'm only showing very very
> dirty code for tests. Sorry for many mails.

Sorry, I didn't mean to be quite so blunt - blame early morning, and
lack of caffeine. I really do appreciate your help (and patience!).


On 22/08/2019 09:46, Akira Kakuto wrote:>> gswin32 article9.ps
>> fails with
>> Last OS error: Permission denied.
>> But this seems natural because
>> C:/Windows/Fonts/msgothic.ttc
>> may not be included in allowd paths.
>
> gswin32 article9.ps
> became OK by changing paths to lower case, because
> Windows OS is not case sensitive:
<SNIP>

As Ken mentioned, we've been discussing this on our IRC channel.

The problem is, that is no longer necessarily true. Windows can be both
case sensitive and not, and that can change depending on the underlying
file system.

It also would raise the issue of security: *someone* would be unhappy
that we allowed access to C:\Users\cjl\myfile.ps when they had specified
C:\Users\CJL\myfile.ps or similar.


I assume we are trying to open C:/Windows/Fonts/msgothic.ttc as a
substitute for a missing CIDFont, thus it's coming from a cidfmap file.
In which case, the permission path *ought* to be drawn from the cifmap
record (similarly from Fontmap for regular fonts).

If article9.ps is referencing the font file explicitly, then I think the
only sane solution would be to use matching paths, including case. FWIW,
you can do:
--permit-file-read="C:/Windows/Fonts/*"


I have a solution for the other problems, but rather than to commit it
(as I did yesterday), I'm going to give others a chance to test it. It's
a little more involved, and ends up doing what I was trying to avoid
yesterday, but nevertheless, if you want to give it a try, you can see
it in my own repo:

http://git.ghostscript.com/?p=user/chrisl/ghostpdl.git;a=commitdiff;h=cb0072409186


Chris