[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-2011-g53ab3ec

[email protected] (Chris Liddell) Wed, 4 Dec 2019 12:53:40 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  53ab3ecee8a60d412c2bf1406340bf9cb228e106 (commit)
      from  c25d59001421845d0ff74735388d450d62b459d5 (commit)

----------------------------------------------------------------------
commit 53ab3ecee8a60d412c2bf1406340bf9cb228e106
Author: Chris Liddell <[email protected]>
Date:   Wed Dec 4 12:23:02 2019 +0000

    Bug 701969: Fix fontconfig path permissions handling
    
    The paths from fontconfig to be added to the permit file reading list was not
    having the trailing directory separator added to indicate we want to allow
    the directory to be read.
    
    Also, tweak the path/filename splitting (for the permit file read list) when
    parsing the cidfmap so it matches the improved version in gs_fonts.ps

diff --git a/Resource/Init/gs_cidfm.ps b/Resource/Init/gs_cidfm.ps
index cd9ed88..e123bfc 100644
--- a/Resource/Init/gs_cidfm.ps
+++ b/Resource/Init/gs_cidfm.ps
@@ -141,7 +141,7 @@ currentdict 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
 
 % <file> .addcidfmappath -
@@ -214,7 +214,7 @@ currentdict end def
     } loop
   } forall
   currentdict end
-  {exch pop (/) concatstrings /PermitFileReading exch .addcontrolpath} forall
+  {exch pop /PermitFileReading exch .addcontrolpath} forall
 
   % Checks for vicious substitution cycles.
   dup length dict copy                  % <<map>>
diff --git a/base/gp_unix.c b/base/gp_unix.c
index 6d2b8b1..ecf0e8a 100644
--- a/base/gp_unix.c
+++ b/base/gp_unix.c
@@ -356,7 +356,11 @@ void *gp_enumerate_fonts_init(gs_memory_t *mem)
      */
     code = 0;
     while ((dirstr = FcStrListNext(fdirlist)) != NULL && code >= 0) {
-        code = gs_add_control_path(mem, gs_permit_file_reading, (char *)dirstr);
+        char dirstr2[gp_file_name_sizeof];
+        dirstr2[0] = '\0';
+        strncat(dirstr2, (char *)dirstr, gp_file_name_sizeof - 1);
+        strncat(dirstr2, "/", gp_file_name_sizeof);
+        code = gs_add_control_path(mem, gs_permit_file_reading, (char *)dirstr2);
     }
     FcStrListDone(fdirlist);
     if (code < 0) {


Summary of changes:
 Resource/Init/gs_cidfm.ps | 4 ++--
 base/gp_unix.c            | 6 +++++-
 2 files changed, 7 insertions(+), 3 deletions(-)