[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1614-gdea69cd
[email protected] (Chris Liddell)
| Newsgroups | gmane.comp.printing.ghostscript.cvs |
|---|---|
| Message-ID | <[email protected]> |
The ghostpdl branch, master has been updated
via dea69cd04964b27a08c8b340476d58031cb9e517 (commit)
from 5d10fde23ccd74c2721e4870c5914fe7373a7816 (commit)
----------------------------------------------------------------------
commit dea69cd04964b27a08c8b340476d58031cb9e517
Author: Chris Liddell <[email protected]>
Date: Tue Aug 27 14:26:41 2019 +0100
Handle relative FONTPATH values
Prior to 9.21 (specifically: 8abd22010eb4db0fb1b10e430d5f5d83e015ef70), relative
paths for FONTPATH worked, but did so due to a logic fault with how we search
for "lib" files.
When attempting to open file names specified on the command line, we used a
flag set in the command line handling (starting_arg_file) to know whether the
lib file searching logic should try to open the file name directly (as well as
trying the file combined with each path in the search path).
In versions prior to commit 8abd22010eb4 that flag (starting_arg_file) could
remain set to true, even after the command line file(s) had been opened. This
represented a (minor) security risk. Commit 8abd22010eb4 ensured the flag was
properly (re)set, and that caused relative paths for FONTPATH stopped working.
Rather than reintroduce the security risk, update the code that checks whether
the font files exist so it explicitly tries the file name directly, rather than
assuming .libfile (or findlibfile, in this case) does that automatically.
Also remove an extraneous (but benign) dup of the font name.
diff --git a/Resource/Init/gs_fonts.ps b/Resource/Init/gs_fonts.ps
index 38fbbfd..f5e938b 100644
--- a/Resource/Init/gs_fonts.ps
+++ b/Resource/Init/gs_fonts.ps
@@ -1038,13 +1038,21 @@ $error /SubstituteFont { } put
% check <libflag>
{
findlibfile not
- } {
+ }
+ {
+ //true
+ } ifelse
+
+ % if findlibfile didn't work, try just opening the file direcly.
+ {
dup (r) { file } stopped {
pop pop //true
} {
//false
} ifelse
- } ifelse {
+ } if
+
+ {
QUIET not
{ (Can't find \(or can't open\) font file ) print dup print
(.) = flush
@@ -1173,7 +1181,7 @@ $error /SubstituteFont { } put
{ exch pop //true //false }
{
% if we can't load by name check the native font map
- dup .nativeFontmap exch .knownget
+ .nativeFontmap exch .knownget
{ //true //true }
{ //false //false } ifelse
} ifelse
Summary of changes:
Resource/Init/gs_fonts.ps | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)