[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1737-g7c836ca
[email protected] (Ken Sharp) Tue, 22 Oct 2019 08:32:16 +0000 (UTC)
| Newsgroups | gmane.comp.printing.ghostscript.cvs |
|---|---|
| Message-ID | <[email protected]> |
The ghostpdl branch, master has been updated
via 7c836caa3e05a286ac56f39ed45dab65eb979ee9 (commit)
from 95e76aad97b1b1c2da51f7fc7e904168fadb1399 (commit)
----------------------------------------------------------------------
commit 7c836caa3e05a286ac56f39ed45dab65eb979ee9
Author: Ken Sharp <[email protected]>
Date: Tue Oct 22 09:32:05 2019 +0100
Update genfontmap.ps for SAFER default
Bug #701766 " genfontmap.ps Unrecoverable error, exit code 1"
The genfontmap.ps program, supplied as part of the support tools in
'toolbin' rather than Ghostscript proper, relies on the non-standard
PostScript extension operator '.sort'.
As part of the security hardening, as many non-standard operators as
possible were removed from Ghostscript when SAFER is set, including
.sort, and with version 9.50 SAFER becomes the default.
This commit simply updates the genfontmap.ps program to check that it
is being run with NOSAFER, emits a warning and exits if this is not the
case. Also update the comments to indicate why we are doing this.
diff --git a/toolbin/genfontmap.ps b/toolbin/genfontmap.ps
index 86b26ea..565dcc7 100644
--- a/toolbin/genfontmap.ps
+++ b/toolbin/genfontmap.ps
@@ -16,10 +16,15 @@
% Create a Fontmap format file after scanning the FONTPATH directories
%
+% From Ghostscript version 9.50 onwards the default operation is to run with
+% SAFER defined; this disables a number of PostScript operators, specifically
+% in this case the .sort operator, which is used by this program. In order
+% to use this program you must run with -dNOSAFER.
+%
% Example usage:
-% windows: gswin32c -q -sFONTPATH=c:/windows/fonts genfontmap.ps > myFontmap
+% windows: gswin32c -dNOSAFER -q -sFONTPATH=c:/windows/fonts genfontmap.ps > myFontmap
%
-% unix: gs -q -sFONTPATH=/usr/local/fonts genfontmap.ps > myFontmap
+% unix: gs -dNOSAFER -q -sFONTPATH=/usr/local/fonts genfontmap.ps > myFontmap
%
% The myFontmap file created by the above can be renamed to Fontmap and
% placed in the LIBPATH directory.
@@ -33,6 +38,13 @@ FONTPATH length 0 eq {
flush quit
} if
+% Since version 9.50, ensure we are running in NOSAFER so that .sort is available
+/NOSAFER where {/NOSAFER get not}{true} ifelse
+{
+ (\n You must use the '-dNOSAFER' option in order to execute this program.\n\n) =error
+ flush quit
+} if
+
QUIET not {
(\n You must use the '-q' option in order to generate a clean Fontmap.\n\n) =error
flush quit
Summary of changes:
toolbin/genfontmap.ps | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)