The following command fails with -dSAFER (infoflow.eps from doxygen source code): gs -dSAFER -sDEVICE=pdfwrite -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray -o test.pdf doc/infoflow.eps GPL Ghostscript 9.24 (2018-09-03) Copyright (C) 2018 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. ./base/gsicc_manage.c:1244: gsicc_open_search(): Could not find default_gray.icc | ./base/gsicc_manage.c:2025: gsicc_set_device_profile(): cannot find device profile ./base/gsicc_manage.c:1244: gsicc_open_search(): Could not find default_gray.icc | ./base/gsicc_manage.c:2025: gsicc_set_device_profile(): cannot find device profile Unrecoverable error: undefined in setpagedevice Operand stack: true true --nostringval-- setpagedevice --nostringval-- true The problem is that ghostscript cannot read /usr/local/share/ghostscript/9.24/iccprofiles because it isn't listed in PermitFileReading. The following hack fixes it, but it's a bit convoluted because ICCProfilesDir has a \000 character at the end. --- Resource/Init/gs_init.ps.orig 2018-09-03 08:50:27 UTC +++ Resource/Init/gs_init.ps @@ -2041,6 +2041,7 @@ readonly def % Default resources (OpenVMS, see comment above.) : [ currentsystemparams /GenericResourceDir get] (*) .file_name_separator (*) concatstrings concatstrings .generate_dir_list_templates + currentuserparams /ICCProfilesDir get copystring dup dup length 1 sub (*) putinterval } if ] /PermitFileWriting [
*** Bug 699736 has been marked as a duplicate of this bug. ***
*** Bug 699724 has been marked as a duplicate of this bug. ***
Fixed in: http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=c8c01f8c4164 I opted to fix the returned string so it didn't include the terminating NULL - otherwise, same fix - thank you!
(In reply to Chris Liddell (chrisl) from comment #3) > + currentuserparams /ICCProfilesDir known {currentuserparams /ICCProfilesDir get} if That doesn't have * at the end does it? I think you need this: currentuserparams /ICCProfilesDir known {[currentuserparams /ICCProfilesDir get] (*) .generate_dir_list_templates} if
(In reply to Tijl Coosemans from comment #4) > (In reply to Chris Liddell (chrisl) from comment #3) > > + currentuserparams /ICCProfilesDir known {currentuserparams /ICCProfilesDir get} if > > That doesn't have * at the end does it? I think you need this: > > currentuserparams /ICCProfilesDir known {[currentuserparams /ICCProfilesDir > get] (*) .generate_dir_list_templates} if Oops, sorry about that. I'l sort it out in a moment.
Add in the wildcard character: http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=13418541a5ae Thanks for noticing.
(In reply to Chris Liddell (chrisl) from comment #6) > http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=13418541a5ae I haven't tested it, but I don't think you need to copy the tempfilepaths array. You can just use: //tempfilepaths (*) .generate_dir_list_templates