diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2021-03-24 13:08:16 +0000 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2021-03-24 13:08:16 +0000 |
commit | 893394eb46ed81e1a7964b510f1ed1bebb3b8dd0 (patch) | |
tree | a4d6d52f22e00d25ad18fc1bf9cfc3d5b885b9d6 | |
parent | 3775bc48cc4747b1eeccc234d14faa4cc63eb4ee (diff) | |
parent | dc7533f716adc0628f76310bd182e4001be7b99e (diff) | |
download | ghostpdl-893394eb46ed81e1a7964b510f1ed1bebb3b8dd0.tar.gz |
Merge branch 'master' into pdfi
-rw-r--r-- | Resource/Init/gs_cmap.ps | 51 | ||||
-rw-r--r-- | Resource/Init/pdf_main.ps | 16 | ||||
-rw-r--r-- | configure.ac | 20 | ||||
-rw-r--r-- | devices/gdevdsp.c | 2 | ||||
-rw-r--r-- | devices/vector/gdevpdfp.c | 2 | ||||
-rw-r--r-- | man/gs.1 | 41 | ||||
-rw-r--r-- | man/ps2pdfwr.1 | 3 | ||||
-rw-r--r-- | psi/msvc.mak | 2 | ||||
-rwxr-xr-x | toolbin/gitlog2changelog.py | 4 |
9 files changed, 78 insertions, 63 deletions
diff --git a/Resource/Init/gs_cmap.ps b/Resource/Init/gs_cmap.ps index 0c2e14215..111043867 100644 --- a/Resource/Init/gs_cmap.ps +++ b/Resource/Init/gs_cmap.ps @@ -224,11 +224,19 @@ /beginbfchar { % <count> beginbfchar - pop mark } bind def -/endbfchar { % <code> <to_code|charname> ... endbfchar - counttomark 2 idiv { - counttomark -2 roll % process in correct order - .addbfchar - } repeat 1 .appendmap +/endbfchar { % [ <code> <to_code|charname> ... endbfchar + ] [ //true % [<da><ta>] [ true + 3 -1 roll % [ true [<da><ta>] + { + exch { + //false % [ <da> false + } { % [ <da> <ta> + .addbfchar % [ prefix params key value font_index + //true + } ifelse + } forall + pop + 1 .appendmap } bind def /beginbfrange { % <count> beginbfrange - @@ -236,26 +244,35 @@ } bind def /endbfrange { % <code_lo> <code_hi> <to_code|(charname*)> ... % endbfrange - - counttomark 3 idiv { - counttomark -3 roll % process in correct order - dup type dup /arraytype eq exch /packedarraytype eq or { + ] [ 0 % [<da><ta><set>] [ 0 + 3 -1 roll % [ 0 [<da><ta><set>] + { + exch % [ <da> 0 + { 1 2 + { + dup type dup /arraytype eq exch /packedarraytype eq or { % Array value, split up. - exch pop { + exch pop { % Stack: code to_code|charname - 1 index exch .addbfchar + 1 index exch .addbfchar % Increment the code. As noted above, we require % that only the last byte vary, but we still must % mask it after incrementing, in case the last % value was 0xff. % Stack: code prefix params key value fontindex - 6 -1 roll dup length string copy - dup dup length 1 sub 2 copy get 1 add 255 and put - } forall pop - } { + 6 -1 roll dup length string copy + dup dup length 1 sub 2 copy get 1 add 255 and put + } forall pop + } { % Single value, handle directly. - .addbfrange - } ifelse - } repeat 1 .appendmap + .addbfrange + } ifelse + 0 + } + } exch get exec + } forall + pop + 1 .appendmap } bind def /.addbfchar { % <code> <to_code|charname> .addbfchar diff --git a/Resource/Init/pdf_main.ps b/Resource/Init/pdf_main.ps index 7953d8665..fba58369b 100644 --- a/Resource/Init/pdf_main.ps +++ b/Resource/Init/pdf_main.ps @@ -3049,13 +3049,10 @@ currentdict /PDF2PS_matrix_key undef 1 index /ProcessColorModel get /DeviceCMYK eq { PageSpotColors 0 gt % count of colorants NOT including CMYK and - } { - } ifelse + } if /PageUsesOverprint exch def % the page needs OP simulation so set device param. } if - pop PageUsesOverprint currentdict end - setpagedevice - /PageUsesOverprint exch def % tuck it away in the pagedict + pop currentdict end setpagedevice } bind executeonly def /.free_page_resources { % - .free_page_resources - @@ -3133,10 +3130,10 @@ currentdict /PDF2PS_matrix_key undef /devColors exch def % put into our convenience dict dup /HaveTransparency .knownget not { //false } if /devSupportsTrans exch def % put into our convenience dict - /Overprint get + dup /Overprint get /SimOP exch def % put into our convenience dict SimOP /simulate eq - PageUsesOverprint + exch /PageUsesOverprint .knownget not { //false } if and % both Overprint==/simulate and PageUsesOverprint { % Determine if the device needs the special pdf14 compositor push @@ -3146,7 +3143,6 @@ currentdict /PDF2PS_matrix_key undef } { //false % Overprint is not /simulate or PageUseOverprint is false } ifelse - % Determine if the device needs SMask for Overprint SimOP /simulate eq { //true % we will need setupOPrtans for Compatible BM @@ -3195,9 +3191,9 @@ currentdict /PDF2PS_matrix_key undef % push a pdf14devicefilter to handle the overprint simulation using the pdf14 device. currentpagedevice dup /Overprint get /simulate eq - exch /PageSpotColors known + 1 index /PageSpotColors known not and - PageUsesOverprint + exch /PageUsesOverprint .knownget not { //false } if and { % Show the page within a PDF 1.4 device filter for overprint_simulation. diff --git a/configure.ac b/configure.ac index 393a6da16..725ca300c 100644 --- a/configure.ac +++ b/configure.ac @@ -855,12 +855,30 @@ if test x$with_tesseract != xno; then elif test x$SYNC = xnosync ; then AC_MSG_ERROR([Threading disabled or not available. Tesseract OCR relies on threading. Rerun configure with "--without-tesseract" to exclude OCR from the build]) else + + save_cxxflags="$CXXFLAGS" + cxxflags_to_try="-std=c++17 -stdlib=libstdc++" + CXXFLAGS_TO_USE="" + + AC_MSG_CHECKING([supported C++ compiler flags]) + for flag in $cxxflags_to_try ; do + CXXFLAGS="$CXXFLAGS $flag" + + AC_TRY_COMPILE(, [return 0;], [ + echo " $flag"; CXXFLAGS_TO_USE="$CXXFLAGS_TO_USE $flag" + ]) + + CXXFLAGS="$old_cflags" + done + + CXXFLAGS="$save_cxxflags $CXXFLAGS_TO_USE" + dnl -------------------------------------------------- dnl check for sse4.1, avx, avx2 or fma dnl -------------------------------------------------- AC_MSG_CHECKING([sse4.1 support]) save_cxxflags=$CXXFLAGS - TESS_CXXFLAGS="" + TESS_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -msse4.1" TESS_SSE4_1="" diff --git a/devices/gdevdsp.c b/devices/gdevdsp.c index 944ae0836..10cfd85e1 100644 --- a/devices/gdevdsp.c +++ b/devices/gdevdsp.c @@ -1646,7 +1646,7 @@ display_size_buf_device(gx_device_buf_space_t *space, gx_device *target, int height, bool for_band) { gx_device_display *ddev = (gx_device_display *)target; - gx_device_memory mdev; + gx_device_memory mdev = { 0 }; int code; int planar = ddev->nFormat & (DISPLAY_PLANAR | DISPLAY_PLANAR_INTERLEAVED); int interleaved = (ddev->nFormat & DISPLAY_PLANAR_INTERLEAVED); diff --git a/devices/vector/gdevpdfp.c b/devices/vector/gdevpdfp.c index ffc337a56..e78d9596c 100644 --- a/devices/vector/gdevpdfp.c +++ b/devices/vector/gdevpdfp.c @@ -852,7 +852,7 @@ gdev_pdf_put_params_impl(gx_device * dev, const gx_device_pdf * save_dev, gs_par } } - if (pdev->Linearise && !gp_fseekable(pdev->file)) { + if (pdev->Linearise && pdev->file != NULL && !gp_fseekable(pdev->file)) { emprintf(pdev->memory, "Can't linearise a non-seekable output file, ignoring\n"); pdev->Linearise = false; } @@ -281,10 +281,7 @@ X Windows). This may be needed if the platform fonts look undesirably different from the scalable fonts. .TP .B \-dSAFER -Restricts file operations the job can perform. Strongly recommended for -spoolers, conversion scripts or other sensitive environments where a badly -written or malicious PostScript program code must be prevented from changing -important files. +Restricts file operations the job can perform. Now the default mode of operation. .TP .B \-dWRITESYSTEMDICT Leaves "systemdict" writable. This is necessary when running special @@ -301,37 +298,21 @@ device, as described above. .PP The .B \-dSAFER -option disables the "deletefile" and "renamefile" operators and prohibits -opening piped commands ("%pipe%\fIcmd\fR"). Only "%stdout" and "%stderr" can be -opened for writing. It also disables reading from files, except for "%stdin", -files given as a command line argument, and files contained in paths given by -LIBPATH and FONTPATH or specified by the system params /FontResourceDir and -/GenericResourceDir. -.PP -This mode also sets the .LockSafetyParams parameter of the initial output device -to protect against programs that attempt to write to files using the OutputFile -device parameter. Since the device parameters specified on the command line, -including OutputFile, are set prior to SAFER mode, use of "-sOutputFile=..." on -the command line is unrestricted. -.PP -SAFER mode prevents changing the /GenericResourceDir, /FontResourceDir, -/SystemParamsPassword, and /StartJobPassword. -.PP -While SAFER mode is not the default, it is the default for many wrapper scripts -such as ps2pdf and may be the default in a subsequent release of Ghostscript. -Thus when running programs that need to open files or set restricted parameters +option restricts file system accesses to those files and directories +allowed by the relevant environment variables (such as GS_LIB) or +by the command line parameters (see https://ghostscript.com/doc/current/Use.htm +for details). +.PP +SAFER mode is now the default mode of operation. Thus when running programs that +need to open files or set restricted parameters you should pass the .B \-dNOSAFER command line option or its synonym .BR \-dDELAYSAFER . .PP -When running with -.B \-dNOSAFER -it is possible to perform a "save" followed by ".setsafe", execute a file or -procedure in SAFER mode, and then use "restore" to return to NOSAFER mode. In -order to prevent the save object from being restored by the foreign file or -procedure, the ".runandhide" operator should be used to hide the save object -from the restricted procedure. +Running with NOSAFER/DELAYSAFER (as the same suggests) loosens the security +and is thus recommended ONLY for debugging or in VERY controlled workflows, +and strongly NOT recommended in any other circumstances. .SH FILES .PP The locations of many Ghostscript run-time files are compiled into the diff --git a/man/ps2pdfwr.1 b/man/ps2pdfwr.1 index 363fd39ea..f75d0bb39 100644 --- a/man/ps2pdfwr.1 +++ b/man/ps2pdfwr.1 @@ -15,7 +15,8 @@ as well as the appropriate .B -dOutputFile argument, all preceded and followed by any command-line arguments. Finally, the security option .B -dSAFER -is prepended before all the other options. +is prepended before all the other options (This is now redundant as "SAFER" is now the default, +but the option does no harm). The version-specific .B ps2pdf diff --git a/psi/msvc.mak b/psi/msvc.mak index 823eea48e..0a8464538 100644 --- a/psi/msvc.mak +++ b/psi/msvc.mak @@ -744,7 +744,7 @@ LEPTONICADIR=leptonica !endif !if exist("tesseract") TESSERACTDIR=tesseract -TESSCXXFLAGS=-DHAVE_AVX -DHAVE_AVX2 -DHAVE_SSE4_1 -DHAVE_FMA -D__AVX__ -D__AVX2__ -D__FMA__ -D__SSE4_1__ /EHsc /std:c++17 +TESSCXXFLAGS=-DHAVE_AVX -DHAVE_AVX2 -DHAVE_SSE4_1 -DHAVE_FMA -D__AVX__ -D__AVX2__ -D__FMA__ -D__SSE4_1__ /EHsc /std:c++17 /utf-8 !endif !if defined(TESSERACTDIR) && defined(LEPTONICADIR) OCR_VERSION=1 diff --git a/toolbin/gitlog2changelog.py b/toolbin/gitlog2changelog.py index 398916d03..69ff601f0 100755 --- a/toolbin/gitlog2changelog.py +++ b/toolbin/gitlog2changelog.py @@ -51,7 +51,9 @@ else: for csum in commit_list: # we have to use the slightly baroque syntax: git log --cc --topo-order <commit>^...<commit> # where the "^" indicates the commit prior to the one we're processing with - cmd="git log --name-only --topo-order --date=iso -n1 " + csum + "^" + "..." + csum +# cmd="git log --name-only --topo-order --date=iso -n1 " + csum + "^" + "..." + csum + + cmd="git log --name-only --topo-order --date=iso -n1 " + csum + "^" + "..." + csum # this leaves out the file list for each commit res = os.popen(cmd, "r") commit=res.readlines() # This assumes the order of the lines..... |