[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1917-g7a56ef4

[email protected] (Chris Liddell) Thu, 21 Nov 2019 11:44:18 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  7a56ef4aed70a50bcd7731b61e59850e98d08a4d (commit)
      from  5e60fc862a73898ce048730d0c23c00b9ddb5578 (commit)

----------------------------------------------------------------------
commit 7a56ef4aed70a50bcd7731b61e59850e98d08a4d
Author: Chris Liddell <[email protected]>
Date:   Thu Nov 21 11:05:36 2019 +0000

    Ensure paths from Fontmap end in a directory separator
    
    Since it's normal for multiple font files to be grouped together in a directory,
    we strip the file name off, and add just the directory to the permit read list,
    rather than flood the list with every font file.
    
    The problem is, we weren't appending the directory separator character showing
    the directory was reading permitted.
    
    This commit does that.
    
    Also, add extra detail to the documentation about this aspect of file
    permissions lists.

diff --git a/Resource/Init/gs_fonts.ps b/Resource/Init/gs_fonts.ps
index b271b57..204e283 100644
--- a/Resource/Init/gs_fonts.ps
+++ b/Resource/Init/gs_fonts.ps
@@ -69,7 +69,7 @@ end def
 % <dir.../base.extn> .basename <dir>
 /.splitdirname {
     (/) rsearch { //true } { (\\) rsearch } ifelse
-  {3 -2 roll pop pop //true}{//false} ifelse
+  {exch concatstrings exch pop //true}{//false} ifelse
 } bind def
 
 % <dict> .addfontmappermitpaths
diff --git a/doc/Fonts.htm b/doc/Fonts.htm
index 3424314..09e8719 100644
--- a/doc/Fonts.htm
+++ b/doc/Fonts.htm
@@ -131,7 +131,20 @@ with the names of font <em>files</em>, such as
 aliases for font names, so that for instance,
 <code>/NimbusNo9L-Regu</code> means the same font as
 <code>/Times-Roman</code>.</p>
-
+<p>Where a mapping in <code>Fontmap</code> maps a font name to a path/file,
+the directory containing the font file is automatically added to the <code>permit
+file read</code> list. For example:
+<br>
+<code>/Arial           (/usr/share/fonts/truetype/msttcorefonts/arial.ttf) ;</code>
+<br>
+will result in the path <code>/usr/share/fonts/truetype/msttcorefonts/</code> being
+added to the <code>permit file read</code> list. This is done on the basis that font files
+are often grouped in common directories, and rather than risk the file permissions lists
+being swamped with (potentially) hundreds of individual files, it makes sense to add the
+directories.
+<p><b>NOTE:</b> Fontmap is processed (and the paths added to the file permissions list) during
+initialisation of the Postscript interpreter, so any attempt by a Postscript job to change the
+font map cannot influence the file permissions list.
 <hr>
 
 <h2><a name="Free_fonts"></a>Ghostscript's free fonts</h2>
diff --git a/doc/Use.htm b/doc/Use.htm
index 8743a37..aee3fcd 100644
--- a/doc/Use.htm
+++ b/doc/Use.htm
@@ -2761,7 +2761,10 @@ names are separated by "<code>:</code>" on Unix systems, by
     <dt><code>-sFONTPATH=</code><em>dir1</em><code>;</code><em>dir2</em><code>;</code><em>...</em></dt>
 <dd>Specifies a list of directories that will be scanned when looking for
 fonts not found on the search path, overriding the environment variable
-    <code>GS_FONTPATH</code>.</dd>
+    <code>GS_FONTPATH</code>.
+<p>By implication, any paths specified by <code>FONTPATH</code> or <code>GS_FONTPATH</code> are automatically
+added to the <code>permit file read</code> list (see "<a href="#Safer">-dSAFER</a>").
+</dd>
 </dl>
 
 <dl>


Summary of changes:
 Resource/Init/gs_fonts.ps |  2 +-
 doc/Fonts.htm             | 15 ++++++++++++++-
 doc/Use.htm               |  5 ++++-
 3 files changed, 19 insertions(+), 3 deletions(-)