More upstream fixes for bug #599564.

This commit is contained in:
Tim Waugh 2010-08-26 14:46:34 +01:00
parent 0c1e7532d2
commit 51b02415a0
2 changed files with 199 additions and 22 deletions

View File

@ -1,6 +1,6 @@
diff -up ghostscript-8.71/base/bcwin32.mak.SEARCH_HERE_FIRST ghostscript-8.71/base/bcwin32.mak
--- ghostscript-8.71/base/bcwin32.mak.SEARCH_HERE_FIRST 2009-11-05 22:24:30.000000000 +0000
+++ ghostscript-8.71/base/bcwin32.mak 2010-08-25 16:00:06.732142141 +0100
+++ ghostscript-8.71/base/bcwin32.mak 2010-08-26 14:42:24.564965845 +0100
@@ -78,13 +78,10 @@ GS_LIB_DEFAULT=$(GSROOTDIR)/Resource/Ini
# Define whether or not searching for initialization files should always
@ -19,7 +19,7 @@ diff -up ghostscript-8.71/base/bcwin32.mak.SEARCH_HERE_FIRST ghostscript-8.71/ba
# Define the name of the interpreter initialization file.
diff -up ghostscript-8.71/base/macos-mcp.mak.SEARCH_HERE_FIRST ghostscript-8.71/base/macos-mcp.mak
--- ghostscript-8.71/base/macos-mcp.mak.SEARCH_HERE_FIRST 2009-11-05 22:24:30.000000000 +0000
+++ ghostscript-8.71/base/macos-mcp.mak 2010-08-25 16:00:06.735142115 +0100
+++ ghostscript-8.71/base/macos-mcp.mak 2010-08-26 14:42:24.565965206 +0100
@@ -53,12 +53,9 @@ GS_DOCDIR=:doc
# Define whether or not searching for initialization files should always
@ -37,7 +37,7 @@ diff -up ghostscript-8.71/base/macos-mcp.mak.SEARCH_HERE_FIRST ghostscript-8.71/
# (There is no reason to change this.)
diff -up ghostscript-8.71/base/macosx.mak.SEARCH_HERE_FIRST ghostscript-8.71/base/macosx.mak
--- ghostscript-8.71/base/macosx.mak.SEARCH_HERE_FIRST 2008-10-02 20:33:22.000000000 +0100
+++ ghostscript-8.71/base/macosx.mak 2010-08-25 16:00:06.745019041 +0100
+++ ghostscript-8.71/base/macosx.mak 2010-08-26 14:42:24.567964998 +0100
@@ -78,12 +78,9 @@ GS_LIB_DEFAULT=$(gsdatadir)/Resource/Ini
# Define whether or not searching for initialization files should always
@ -55,7 +55,7 @@ diff -up ghostscript-8.71/base/macosx.mak.SEARCH_HERE_FIRST ghostscript-8.71/bas
# (There is no reason to change this.)
diff -up ghostscript-8.71/base/Makefile.in.SEARCH_HERE_FIRST ghostscript-8.71/base/Makefile.in
--- ghostscript-8.71/base/Makefile.in.SEARCH_HERE_FIRST 2009-12-18 07:04:10.000000000 +0000
+++ ghostscript-8.71/base/Makefile.in 2010-08-25 16:00:06.767101477 +0100
+++ ghostscript-8.71/base/Makefile.in 2010-08-26 14:42:24.568840684 +0100
@@ -96,12 +96,9 @@ GS_CACHE_DIR="~/.ghostscript/cache/"
# Define whether or not searching for initialization files should always
@ -73,7 +73,7 @@ diff -up ghostscript-8.71/base/Makefile.in.SEARCH_HERE_FIRST ghostscript-8.71/ba
# (There is no reason to change this.)
diff -up ghostscript-8.71/base/msvclib.mak.SEARCH_HERE_FIRST ghostscript-8.71/base/msvclib.mak
--- ghostscript-8.71/base/msvclib.mak.SEARCH_HERE_FIRST 2010-01-07 10:53:36.000000000 +0000
+++ ghostscript-8.71/base/msvclib.mak 2010-08-25 16:00:06.790017275 +0100
+++ ghostscript-8.71/base/msvclib.mak 2010-08-26 14:42:24.570840275 +0100
@@ -49,13 +49,10 @@ GS_LIB_DEFAULT=$(GSROOTDIR)/Resource/Ini
# Define whether or not searching for initialization files should always
@ -92,7 +92,7 @@ diff -up ghostscript-8.71/base/msvclib.mak.SEARCH_HERE_FIRST ghostscript-8.71/ba
# Define the name of the interpreter initialization file.
diff -up ghostscript-8.71/base/openvms.mak.SEARCH_HERE_FIRST ghostscript-8.71/base/openvms.mak
--- ghostscript-8.71/base/openvms.mak.SEARCH_HERE_FIRST 2009-11-05 22:24:30.000000000 +0000
+++ ghostscript-8.71/base/openvms.mak 2010-08-25 16:00:06.819017200 +0100
+++ ghostscript-8.71/base/openvms.mak 2010-08-26 14:42:24.571840163 +0100
@@ -68,12 +68,9 @@ GS_LIB_DEFAULT=GS_ROOT:[RESOURCE.INIT],G
# Define whether or not searching for initialization files should always
@ -110,7 +110,7 @@ diff -up ghostscript-8.71/base/openvms.mak.SEARCH_HERE_FIRST ghostscript-8.71/ba
# (There is no reason to change this.)
diff -up ghostscript-8.71/base/openvms.mmk.SEARCH_HERE_FIRST ghostscript-8.71/base/openvms.mmk
--- ghostscript-8.71/base/openvms.mmk.SEARCH_HERE_FIRST 2009-01-08 09:17:18.000000000 +0000
+++ ghostscript-8.71/base/openvms.mmk 2010-08-25 16:00:06.834017369 +0100
+++ ghostscript-8.71/base/openvms.mmk 2010-08-26 14:42:24.572840641 +0100
@@ -73,12 +73,9 @@ GS_LIB_DEFAULT=GS_LIB
# Define whether or not searching for initialization files should always
@ -128,7 +128,7 @@ diff -up ghostscript-8.71/base/openvms.mmk.SEARCH_HERE_FIRST ghostscript-8.71/ba
# (There is no reason to change this.)
diff -up ghostscript-8.71/base/ugcclib.mak.SEARCH_HERE_FIRST ghostscript-8.71/base/ugcclib.mak
--- ghostscript-8.71/base/ugcclib.mak.SEARCH_HERE_FIRST 2008-11-05 20:41:22.000000000 +0000
+++ ghostscript-8.71/base/ugcclib.mak 2010-08-25 16:00:06.842017457 +0100
+++ ghostscript-8.71/base/ugcclib.mak 2010-08-26 14:42:24.573840607 +0100
@@ -30,7 +30,7 @@ gsdir = /usr/local/share/ghostscript
gsdatadir = $(gsdir)/$(GS_DOT_VERSION)
GS_DOCDIR=$(gsdatadir)/doc
@ -140,7 +140,7 @@ diff -up ghostscript-8.71/base/ugcclib.mak.SEARCH_HERE_FIRST ghostscript-8.71/ba
#GENOPT=-DDEBUG
diff -up ghostscript-8.71/base/unixansi.mak.SEARCH_HERE_FIRST ghostscript-8.71/base/unixansi.mak
--- ghostscript-8.71/base/unixansi.mak.SEARCH_HERE_FIRST 2009-11-05 22:24:30.000000000 +0000
+++ ghostscript-8.71/base/unixansi.mak 2010-08-25 16:00:06.858017358 +0100
+++ ghostscript-8.71/base/unixansi.mak 2010-08-26 14:42:24.575840435 +0100
@@ -73,12 +73,9 @@ GS_LIB_DEFAULT=$(gsdatadir)/Resource/Ini
# Define whether or not searching for initialization files should always
@ -158,7 +158,7 @@ diff -up ghostscript-8.71/base/unixansi.mak.SEARCH_HERE_FIRST ghostscript-8.71/b
# (There is no reason to change this.)
diff -up ghostscript-8.71/base/unix-gcc.mak.SEARCH_HERE_FIRST ghostscript-8.71/base/unix-gcc.mak
--- ghostscript-8.71/base/unix-gcc.mak.SEARCH_HERE_FIRST 2009-11-11 15:50:28.000000000 +0000
+++ ghostscript-8.71/base/unix-gcc.mak 2010-08-25 16:00:06.888017760 +0100
+++ ghostscript-8.71/base/unix-gcc.mak 2010-08-26 14:42:24.576840199 +0100
@@ -77,12 +77,9 @@ GS_LIB_DEFAULT=$(gsdatadir)/Resource/Ini
# Define whether or not searching for initialization files should always
@ -176,7 +176,7 @@ diff -up ghostscript-8.71/base/unix-gcc.mak.SEARCH_HERE_FIRST ghostscript-8.71/b
# (There is no reason to change this.)
diff -up ghostscript-8.71/base/watclib.mak.SEARCH_HERE_FIRST ghostscript-8.71/base/watclib.mak
--- ghostscript-8.71/base/watclib.mak.SEARCH_HERE_FIRST 2009-01-08 09:17:18.000000000 +0000
+++ ghostscript-8.71/base/watclib.mak 2010-08-25 16:00:06.896017307 +0100
+++ ghostscript-8.71/base/watclib.mak 2010-08-26 14:42:24.577840314 +0100
@@ -20,7 +20,7 @@ AROOTDIR=c:/gs
GSROOTDIR=$(AROOTDIR)/gs$(GS_DOT_VERSION)
GS_DOCDIR=$(GSROOTDIR)/doc
@ -188,7 +188,7 @@ diff -up ghostscript-8.71/base/watclib.mak.SEARCH_HERE_FIRST ghostscript-8.71/ba
!ifndef DEBUG
diff -up ghostscript-8.71/base/watcw32.mak.SEARCH_HERE_FIRST ghostscript-8.71/base/watcw32.mak
--- ghostscript-8.71/base/watcw32.mak.SEARCH_HERE_FIRST 2009-11-05 22:24:30.000000000 +0000
+++ ghostscript-8.71/base/watcw32.mak 2010-08-25 16:00:06.914017272 +0100
+++ ghostscript-8.71/base/watcw32.mak 2010-08-26 14:42:24.578840893 +0100
@@ -54,11 +54,8 @@ GS_LIB_DEFAULT=$(GSROOTDIR)/Resource/Ini
# Define whether or not searching for initialization files should always
# look in the current directory first. This leads to well-known security
@ -204,7 +204,7 @@ diff -up ghostscript-8.71/base/watcw32.mak.SEARCH_HERE_FIRST ghostscript-8.71/ba
# (There is no reason to change this.)
diff -up ghostscript-8.71/doc/Use.htm.SEARCH_HERE_FIRST ghostscript-8.71/doc/Use.htm
--- ghostscript-8.71/doc/Use.htm.SEARCH_HERE_FIRST 2010-02-10 18:17:48.000000000 +0000
+++ ghostscript-8.71/doc/Use.htm 2010-08-25 16:00:06.949017319 +0100
+++ ghostscript-8.71/doc/Use.htm 2010-08-26 14:42:24.583840122 +0100
@@ -823,8 +823,8 @@ file name specifies an absolute path.
using the name given. Otherwise it tries directories in this order:
@ -253,7 +253,7 @@ diff -up ghostscript-8.71/doc/Use.htm.SEARCH_HERE_FIRST ghostscript-8.71/doc/Use
<h4><a name="Parameters"></a>Setting parameters</h4>
diff -up ghostscript-8.71/man/gs.1.SEARCH_HERE_FIRST ghostscript-8.71/man/gs.1
--- ghostscript-8.71/man/gs.1.SEARCH_HERE_FIRST 2010-02-10 18:17:48.000000000 +0000
+++ ghostscript-8.71/man/gs.1 2010-08-25 16:00:06.952017346 +0100
+++ ghostscript-8.71/man/gs.1 2010-08-26 14:42:24.586965259 +0100
@@ -208,6 +208,12 @@ whereas \fB\-sname=35\fR is equivalent t
.br
/name (35) def
@ -269,7 +269,7 @@ diff -up ghostscript-8.71/man/gs.1.SEARCH_HERE_FIRST ghostscript-8.71/man/gs.1
equivalent of \fB\-dQUIET\fR.
diff -up ghostscript-8.71/psi/msvc32.mak.SEARCH_HERE_FIRST ghostscript-8.71/psi/msvc32.mak
--- ghostscript-8.71/psi/msvc32.mak.SEARCH_HERE_FIRST 2010-02-02 18:14:37.000000000 +0000
+++ ghostscript-8.71/psi/msvc32.mak 2010-08-25 16:00:06.954017446 +0100
+++ ghostscript-8.71/psi/msvc32.mak 2010-08-26 14:42:24.588840343 +0100
@@ -100,13 +100,10 @@ GS_LIB_DEFAULT=$(GSROOTDIR)/Resource/Ini
# Define whether or not searching for initialization files should always
@ -288,7 +288,7 @@ diff -up ghostscript-8.71/psi/msvc32.mak.SEARCH_HERE_FIRST ghostscript-8.71/psi/
# Define the name of the interpreter initialization file.
diff -up ghostscript-8.71/psi/os2.mak.SEARCH_HERE_FIRST ghostscript-8.71/psi/os2.mak
--- ghostscript-8.71/psi/os2.mak.SEARCH_HERE_FIRST 2009-11-05 22:24:30.000000000 +0000
+++ ghostscript-8.71/psi/os2.mak 2010-08-25 16:00:06.956017546 +0100
+++ ghostscript-8.71/psi/os2.mak 2010-08-26 14:42:24.590840867 +0100
@@ -54,12 +54,9 @@ GS_LIB_DEFAULT=$(GSROOTDIR)/Resource/Ini
# Define whether or not searching for initialization files should always
@ -306,8 +306,23 @@ diff -up ghostscript-8.71/psi/os2.mak.SEARCH_HERE_FIRST ghostscript-8.71/psi/os2
# (There is no reason to change this.)
diff -up ghostscript-8.71/psi/zfile.c.SEARCH_HERE_FIRST ghostscript-8.71/psi/zfile.c
--- ghostscript-8.71/psi/zfile.c.SEARCH_HERE_FIRST 2009-10-04 13:42:07.000000000 +0100
+++ ghostscript-8.71/psi/zfile.c 2010-08-25 16:02:45.521018186 +0100
@@ -903,6 +903,91 @@ check_file_permissions_aux(i_ctx_t *i_ct
+++ ghostscript-8.71/psi/zfile.c 2010-08-26 14:42:24.593842556 +0100
@@ -486,8 +486,13 @@ zstatus(i_ctx_t *i_ctx_p)
struct stat fstat;
int code = parse_file_name(op, &pname, i_ctx_p->LockFilePermissions);
- if (code < 0)
+ if (code < 0) {
+ if (code == e_undefinedfilename) {
+ make_bool(op, 0);
+ code = 0;
+ }
return code;
+ }
code = gs_terminate_file_name(&pname, imemory, "status");
if (code < 0)
return code;
@@ -903,6 +908,91 @@ check_file_permissions_aux(i_ctx_t *i_ct
}
@ -399,7 +414,7 @@ diff -up ghostscript-8.71/psi/zfile.c.SEARCH_HERE_FIRST ghostscript-8.71/psi/zfi
/* Return a file object of of the file searched for using the search paths. */
/* The fname cannot contain a device part (%...%) but the lib paths might. */
/* The startup code calls this to open the initialization file gs_init.ps. */
@@ -917,8 +1002,9 @@ lib_file_open(gs_file_path_ptr lib_path
@@ -917,8 +1007,9 @@ lib_file_open(gs_file_path_ptr lib_path
bool search_with_no_combine = false;
bool search_with_combine = false;
char fmode[4] = { 'r', 0, 0, 0 }; /* room for binary suffix */
@ -410,7 +425,7 @@ diff -up ghostscript-8.71/psi/zfile.c.SEARCH_HERE_FIRST ghostscript-8.71/psi/zfi
/* when starting arg files (@ files) iodev_default is not yet set */
if (iodev == 0)
@@ -932,75 +1018,36 @@ lib_file_open(gs_file_path_ptr lib_path
@@ -932,75 +1023,36 @@ lib_file_open(gs_file_path_ptr lib_path
search_with_no_combine = starting_arg_file;
search_with_combine = true;
}
@ -516,9 +531,168 @@ diff -up ghostscript-8.71/psi/zfile.c.SEARCH_HERE_FIRST ghostscript-8.71/psi/zfi
}
return_error(e_undefinedfilename);
}
diff -up ghostscript-8.71/Resource/Init/gs_fonts.ps.SEARCH_HERE_FIRST ghostscript-8.71/Resource/Init/gs_fonts.ps
--- ghostscript-8.71/Resource/Init/gs_fonts.ps.SEARCH_HERE_FIRST 2008-08-08 05:22:38.000000000 +0100
+++ ghostscript-8.71/Resource/Init/gs_fonts.ps 2010-08-26 14:42:24.606840016 +0100
@@ -939,7 +939,7 @@ $error /SubstituteFont { } put
if
}
{ % Font file name
- .loadfontloop { true exit } if
+ //true .loadfontloop { //true exit } if
}
ifelse
}
@@ -982,39 +982,47 @@ $error /SubstituteFont { } put
/.genericrfn where {
pop
pop dup .fonttempstring /FontResourceDir getsystemparam .genericrfn
- .loadfontloop {
+ //false .loadfontloop {
//true
} {
- dup .nametostring .loadfontloop
+ dup .nametostring
+ //true .loadfontloop
} ifelse
} {
- .loadfontloop
+ //true .loadfontloop
} ifelse
} bind def
-/.loadfontloop { % <fontname> <filename> .loadfontloop
+/.loadfontloop { % <fontname> <filename> <libflag> .loadfontloop
% <font> true
% -or-
% <fontname> false
% See above regarding the use of 'loop'.
{ % Is the font name a string?
- dup type /stringtype ne
- { QUIET not
+ 1 index type /stringtype ne
+ { pop
+ QUIET not
{ (Can't find font with non-string name: ) print dup =only (.) = flush
}
- if pop false exit
- }
- if
- % Can we open the file?
- findlibfile not
- { QUIET not
+ if pop //false exit
+ } if
+
+ % check <libflag>
+ {
+ findlibfile not
+ } {
+ dup (r) { file } stopped {
+ pop pop //true
+ } {
+ //false
+ } ifelse
+ } ifelse {
+ QUIET not
{ (Can't find \(or can't open\) font file ) print dup print
(.) = flush
}
if pop false exit
- }
- if
-
- % Stack: fontname fontfilename fontfile
+ } if
+ % Stack: fontname fontfilename fontfile
DISKFONTS
{ .currentglobal true .setglobal
2 index (r) file
diff -up ghostscript-8.71/Resource/Init/gs_res.ps.SEARCH_HERE_FIRST ghostscript-8.71/Resource/Init/gs_res.ps
--- ghostscript-8.71/Resource/Init/gs_res.ps.SEARCH_HERE_FIRST 2010-01-31 20:30:13.000000000 +0000
+++ ghostscript-8.71/Resource/Init/gs_res.ps 2010-08-26 14:43:57.159839992 +0100
@@ -287,7 +287,8 @@ systemdict begin
} {
(Resource) search {
exch concatstrings
- exch 0 1 getinterval concatstrings exit
+ exch pop
+ .file_name_separator concatstrings exit
} {
pop
} ifelse
@@ -557,46 +558,29 @@ status {
{ forall } 0 get
currentdict end 2 .execn begin
} bind
-/.file_name_is_iodevice_or_absolute
-{ {
- dup length 0 gt {
- dup 0 get (%) 0 get eq {
- pop true exit
- } if
- } if
- .file_name_is_absolute exit
- } loop
-} bind def
-/ResourceFileName
- { % /in (scr)
- exch //.rfnstring cvs % (scr) (n)
- /GenericResourcePathSep getsystemparam exch % (scr) (/) (n)
- Category .namestring % (scr) (/) (n) (c)
- 3 1 roll % (scr) (c) (/) (n)
- concatstrings concatstrings % (scr) (c/n)
- /GenericResourceDir getsystemparam //.file_name_is_iodevice_or_absolute exec not {
- /GenericResourceDir getsystemparam exch concatstrings
- findlibfile
- { % (scr) (p/c/n) file
- pop exch copy true % (p/c/n) true
- } { % (scr) (c/n)
- false % (scr) (c/n) false
- } ifelse
- } { % (scr) (c/n)
- false % (scr) (c/n) false
- } ifelse
- not { % (scr) (c/n)
- /GenericResourceDir getsystemparam % (scr) (c/n) (d/)
- dup length exch % (scr) (c/n) Ld (d/)
- 3 index copy pop % (scr') (c/n) Ld
- 1 index length % (scr') (c/n) Ld Lcn
- 3 index 3 copy pop % (scr') (c/n) Ld Lcn (scr') Ld Lcn
- getinterval % (scr') (c/n) Ld Lcn (scr[Ld:Lcn])
- 4 3 roll exch % (scr') Ld Lcn (c/n) (scr[Ld:Lcn])
- copy pop % (scr'') Ld Lcn
- add 0 exch getinterval % (scr''[0:Ld+Lcn])
- } if
- } bind
+
+/ResourceFileName { % /in (scr) --> (p/c/n)
+ exch //.rfnstring cvs % (scr) (n)
+ /GenericResourcePathSep getsystemparam exch % (scr) (/) (n)
+ Category .namestring % (scr) (/) (n) (c)
+ 3 1 roll % (scr) (c) (/) (n)
+ concatstrings concatstrings % (scr) (c/n)
+ /GenericResourceDir getsystemparam 1 index % (scr) (c/n) (p/) (c/n)
+ concatstrings % (scr) (c/n) (p/c/n)
+ dup status {
+ pop pop pop pop exch pop % (scr) (p/c/n)
+ } {
+ exch % (scr) (p/c/n) (c/n)
+ .libfile {
+ dup .filename pop % (scr) (p/c/n) file (p/c/n')
+ exch closefile % (scr) (p/c/n) (p/c/n')
+ exch pop % (scr) (p/c/n')
+ } {
+ pop % (scr) (p/c/n)
+ } ifelse
+ } ifelse
+ exch copy % (p/c/n)
+} bind
% Additional entries
diff -up ghostscript-8.71/toolbin/msvcxml.bat.SEARCH_HERE_FIRST ghostscript-8.71/toolbin/msvcxml.bat
--- ghostscript-8.71/toolbin/msvcxml.bat.SEARCH_HERE_FIRST 2009-01-26 17:16:47.000000000 +0000
+++ ghostscript-8.71/toolbin/msvcxml.bat 2010-08-25 16:00:06.959017477 +0100
+++ ghostscript-8.71/toolbin/msvcxml.bat 2010-08-26 14:42:24.619840359 +0100
@@ -1428,7 +1428,7 @@ echo ^<UserMacro Name="GS_DOCDIR" Valu
echo ^<UserMacro Name="GS_INIT" Value="gs_init.ps" /^>
echo ^<UserMacro Name="GS_LIB_DEFAULT" Value="$(GSROOTDIR)/lib;$(GSROOTDIR)/Resource/Font;$(AROOTDIR)/fonts" /^>

View File

@ -5,7 +5,7 @@ Summary: A PostScript interpreter and renderer.
Name: ghostscript
Version: %{gs_ver}
Release: 10%{?dist}
Release: 11%{?dist}
# Included CMap data is Redistributable, no modification permitted,
# see http://bugzilla.redhat.com/487510
@ -366,6 +366,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/libgs.so
%changelog
* Thu Aug 26 2010 Tim Waugh <twaugh@redhat.com> 8.71-11
- More upstream fixes for bug #599564.
* Wed Aug 25 2010 Tim Waugh <twaugh@redhat.com> 8.71-10
- Fix implementation of -P- (bug #599564).
- Use -P- and -dSAFER in scripts (bug #599564).