diff -Nru ghostscript-8.71~dfsg2/debian/changelog ghostscript-8.71~dfsg2/debian/changelog --- ghostscript-8.71~dfsg2/debian/changelog 2010-08-19 04:04:54.000000000 -0400 +++ ghostscript-8.71~dfsg2/debian/changelog 2010-12-09 22:39:42.000000000 -0500 @@ -1,3 +1,12 @@ +ghostscript (8.71~dfsg2-6.1) unstable; urgency=high + + * Non-maintainer upload. + * Fix various aspects of CVE-2010-2055: + - Honor -P- command-line option (closes: #584653). + - Set SEARCH_HERE_FIRST=0 by default (closes: #584663). + + -- Michael Gilbert Thu, 09 Dec 2010 21:40:17 -0500 + ghostscript (8.71~dfsg2-6) unstable; urgency=low * Acknowledge pseudo-NMUs. diff -Nru ghostscript-8.71~dfsg2/debian/patches/1010_CVE-2010-2055_fix-584653.patch ghostscript-8.71~dfsg2/debian/patches/1010_CVE-2010-2055_fix-584653.patch --- ghostscript-8.71~dfsg2/debian/patches/1010_CVE-2010-2055_fix-584653.patch 1969-12-31 19:00:00.000000000 -0500 +++ ghostscript-8.71~dfsg2/debian/patches/1010_CVE-2010-2055_fix-584653.patch 2010-12-09 21:57:04.000000000 -0500 @@ -0,0 +1,78 @@ +Description: Honor -P- option +Author: Michael Gilbert +Debian-Bug: http://bugs.debian.org/584653 +Origin: http://svn.ghostscript.com/viewvc/trunk/gs/Resource/Init/gs_res.ps?r1=11510&r2=11515&view=patch +Index: ghostscript-8.71~dfsg2/Resource/Init/gs_res.ps +=================================================================== +--- ghostscript-8.71~dfsg2.orig/Resource/Init/gs_res.ps 2010-01-31 15:30:13.000000000 -0500 ++++ ghostscript-8.71~dfsg2/Resource/Init/gs_res.ps 2010-12-09 21:48:52.000000000 -0500 +@@ -557,46 +557,29 @@ + { 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 -Nru ghostscript-8.71~dfsg2/debian/patches/1011_CVE-2010-2055_fix-584663.patch ghostscript-8.71~dfsg2/debian/patches/1011_CVE-2010-2055_fix-584663.patch --- ghostscript-8.71~dfsg2/debian/patches/1011_CVE-2010-2055_fix-584663.patch 1969-12-31 19:00:00.000000000 -0500 +++ ghostscript-8.71~dfsg2/debian/patches/1011_CVE-2010-2055_fix-584663.patch 2010-12-09 22:03:37.000000000 -0500 @@ -0,0 +1,321 @@ +Description: use SEARCH_HERE_FIRST=0 +Author: Michael Gilbert +Debian-Bug: http://bugs.debian.org/584663 +Index: ghostscript-8.71~dfsg2/psi/msvc32.mak +=================================================================== +--- ghostscript-8.71~dfsg2.orig/psi/msvc32.mak 2010-02-02 13:14:37.000000000 -0500 ++++ ghostscript-8.71~dfsg2/psi/msvc32.mak 2010-12-09 22:01:33.000000000 -0500 +@@ -100,13 +100,10 @@ + + # Define whether or not searching for initialization files should always + # look in the current directory first. This leads to well-known security +-# and confusion problems, but users insist on it. +-# NOTE: this also affects searching for files named on the command line: +-# see the "File searching" section of Use.htm for full details. +-# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended. ++# and confusion problems, but may be convenient sometimes. + + !ifndef SEARCH_HERE_FIRST +-SEARCH_HERE_FIRST=1 ++SEARCH_HERE_FIRST=0 + !endif + + # Define the name of the interpreter initialization file. +Index: ghostscript-8.71~dfsg2/psi/os2.mak +=================================================================== +--- ghostscript-8.71~dfsg2.orig/psi/os2.mak 2009-11-05 17:24:30.000000000 -0500 ++++ ghostscript-8.71~dfsg2/psi/os2.mak 2010-12-09 22:01:33.000000000 -0500 +@@ -54,12 +54,9 @@ + + # Define whether or not searching for initialization files should always + # look in the current directory first. This leads to well-known security +-# and confusion problems, but users insist on it. +-# NOTE: this also affects searching for files named on the command line: +-# see the "File searching" section of Use.htm for full details. +-# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended. ++# and confusion problems, but may be convenient sometimes. + +-SEARCH_HERE_FIRST=1 ++SEARCH_HERE_FIRST=0 + + # Define the name of the interpreter initialization file. + # (There is no reason to change this.) +Index: ghostscript-8.71~dfsg2/doc/Use.htm +=================================================================== +--- ghostscript-8.71~dfsg2.orig/doc/Use.htm 2010-02-10 13:17:48.000000000 -0500 ++++ ghostscript-8.71~dfsg2/doc/Use.htm 2010-12-09 22:01:33.000000000 -0500 +@@ -823,8 +823,8 @@ + using the name given. Otherwise it tries directories in this order: + +
    +-
  1. The current directory (unless disabled by the +--P- switch); ++
  2. The current directory if enabled by the ++-P switch; + +
  3. The directories specified by -I + switches in the command line, if any; +@@ -847,13 +847,10 @@ + directory or a list of directories separated by a character appropriate for + the operating system (":" on Unix systems, + "," on VMS systems, and +-";" on MS Windows systems). We think that trying +-the current directory first is a very bad idea -- it opens serious security +-loopholes and can lead to very confusing errors if one has more than one +-version of Ghostscript in one's environment -- but when we attempted to +-change it, users insisted that we change it back. You can disable looking +-in the current directory first by using the +--P- switch. ++";" on MS Windows systems). ++By default, Ghostscript no longer searches the current directory first ++but provides -P switch for a degree ++of backward compatibility. + +

    + Note that Ghostscript does not use this file searching algorithm for the +@@ -2061,14 +2058,14 @@ +

    +
    -P +
    Makes Ghostscript look first in the current directory for library +-files. This is currently the default. ++files. +
    + +
    +
    -P- +
    Makes Ghostscript not look first in the current + directory for library files (unless, of course, the first explicitly +-supplied directory is "."). ++supplied directory is "."). This is now the default. +
    + +

    Setting parameters

    +Index: ghostscript-8.71~dfsg2/toolbin/msvcxml.bat +=================================================================== +--- ghostscript-8.71~dfsg2.orig/toolbin/msvcxml.bat 2009-01-26 12:16:47.000000000 -0500 ++++ ghostscript-8.71~dfsg2/toolbin/msvcxml.bat 2010-12-09 22:01:33.000000000 -0500 +@@ -1428,7 +1428,7 @@ + echo ^ + echo ^ + echo ^ +-echo ^ ++echo ^ + echo ^ + goto end + +Index: ghostscript-8.71~dfsg2/base/ugcclib.mak +=================================================================== +--- ghostscript-8.71~dfsg2.orig/base/ugcclib.mak 2008-11-05 15:41:22.000000000 -0500 ++++ ghostscript-8.71~dfsg2/base/ugcclib.mak 2010-12-09 22:01:33.000000000 -0500 +@@ -30,7 +30,7 @@ + gsdatadir = $(gsdir)/$(GS_DOT_VERSION) + GS_DOCDIR=$(gsdatadir)/doc + GS_LIB_DEFAULT=$(gsdatadir)/Resource/Init:$(gsdatadir)/lib:$(gsdatadir)/Resource/Font +-SEARCH_HERE_FIRST=1 ++SEARCH_HERE_FIRST=0 + GS_INIT=gs_init.ps + + #GENOPT=-DDEBUG +Index: ghostscript-8.71~dfsg2/base/bcwin32.mak +=================================================================== +--- ghostscript-8.71~dfsg2.orig/base/bcwin32.mak 2009-11-05 17:24:30.000000000 -0500 ++++ ghostscript-8.71~dfsg2/base/bcwin32.mak 2010-12-09 22:01:33.000000000 -0500 +@@ -78,13 +78,10 @@ + + # Define whether or not searching for initialization files should always + # look in the current directory first. This leads to well-known security +-# and confusion problems, but users insist on it. +-# NOTE: this also affects searching for files named on the command line: +-# see the "File searching" section of Use.htm for full details. +-# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended. ++# and confusion problems, but may be convenient sometimes. + + !ifndef SEARCH_HERE_FIRST +-SEARCH_HERE_FIRST=1 ++SEARCH_HERE_FIRST=0 + !endif + + # Define the name of the interpreter initialization file. +Index: ghostscript-8.71~dfsg2/base/macos-mcp.mak +=================================================================== +--- ghostscript-8.71~dfsg2.orig/base/macos-mcp.mak 2009-11-05 17:24:30.000000000 -0500 ++++ ghostscript-8.71~dfsg2/base/macos-mcp.mak 2010-12-09 22:01:33.000000000 -0500 +@@ -53,12 +53,9 @@ + + # Define whether or not searching for initialization files should always + # look in the current directory first. This leads to well-known security +-# and confusion problems, but users insist on it. +-# NOTE: this also affects searching for files named on the command line: +-# see the "File searching" section of Use.htm for full details. +-# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended. ++# and confusion problems, but may be convenient sometimes. + +-SEARCH_HERE_FIRST=1 ++SEARCH_HERE_FIRST=0 + + # Define the name of the interpreter initialization file. + # (There is no reason to change this.) +Index: ghostscript-8.71~dfsg2/base/watclib.mak +=================================================================== +--- ghostscript-8.71~dfsg2.orig/base/watclib.mak 2009-01-08 04:17:18.000000000 -0500 ++++ ghostscript-8.71~dfsg2/base/watclib.mak 2010-12-09 22:01:33.000000000 -0500 +@@ -20,7 +20,7 @@ + GSROOTDIR=$(AROOTDIR)/gs$(GS_DOT_VERSION) + GS_DOCDIR=$(GSROOTDIR)/doc + GS_LIB_DEFAULT=$(GSROOTDIR)/Resource/Init\;$(GSROOTDIR)/lib\;$(GSROOTDIR)/Resource/Font\;$(AROOTDIR)/fonts +-SEARCH_HERE_FIRST=1 ++SEARCH_HERE_FIRST=0 + GS_INIT=gs_init.ps + + !ifndef DEBUG +Index: ghostscript-8.71~dfsg2/base/openvms.mak +=================================================================== +--- ghostscript-8.71~dfsg2.orig/base/openvms.mak 2009-11-05 17:24:30.000000000 -0500 ++++ ghostscript-8.71~dfsg2/base/openvms.mak 2010-12-09 22:01:33.000000000 -0500 +@@ -68,12 +68,9 @@ + + # Define whether or not searching for initialization files should always + # look in the current directory first. This leads to well-known security +-# and confusion problems, but users insist on it. +-# NOTE: this also affects searching for files named on the command line: +-# see the "File searching" section of Use.htm for full details. +-# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended. ++# and confusion problems, but may be convenient sometimes. + +-SEARCH_HERE_FIRST=1 ++SEARCH_HERE_FIRST=0 + + # Define the name of the interpreter initialization file. + # (There is no reason to change this.) +Index: ghostscript-8.71~dfsg2/base/unix-gcc.mak +=================================================================== +--- ghostscript-8.71~dfsg2.orig/base/unix-gcc.mak 2009-11-11 10:50:28.000000000 -0500 ++++ ghostscript-8.71~dfsg2/base/unix-gcc.mak 2010-12-09 22:01:33.000000000 -0500 +@@ -77,12 +77,9 @@ + + # Define whether or not searching for initialization files should always + # look in the current directory first. This leads to well-known security +-# and confusion problems, but users insist on it. +-# NOTE: this also affects searching for files named on the command line: +-# see the "File searching" section of Use.htm for full details. +-# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended. ++# and confusion problems, but may be convenient sometimes. + +-SEARCH_HERE_FIRST=1 ++SEARCH_HERE_FIRST=0 + + # Define the name of the interpreter initialization file. + # (There is no reason to change this.) +Index: ghostscript-8.71~dfsg2/base/unixansi.mak +=================================================================== +--- ghostscript-8.71~dfsg2.orig/base/unixansi.mak 2009-11-05 17:24:30.000000000 -0500 ++++ ghostscript-8.71~dfsg2/base/unixansi.mak 2010-12-09 22:01:33.000000000 -0500 +@@ -73,12 +73,9 @@ + + # Define whether or not searching for initialization files should always + # look in the current directory first. This leads to well-known security +-# and confusion problems, but users insist on it. +-# NOTE: this also affects searching for files named on the command line: +-# see the "File searching" section of Use.htm for full details. +-# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended. ++# and confusion problems, but may be convenient sometimes. + +-SEARCH_HERE_FIRST=1 ++SEARCH_HERE_FIRST=0 + + # Define the name of the interpreter initialization file. + # (There is no reason to change this.) +Index: ghostscript-8.71~dfsg2/base/macosx.mak +=================================================================== +--- ghostscript-8.71~dfsg2.orig/base/macosx.mak 2008-10-02 15:33:22.000000000 -0400 ++++ ghostscript-8.71~dfsg2/base/macosx.mak 2010-12-09 22:01:33.000000000 -0500 +@@ -78,12 +78,9 @@ + + # Define whether or not searching for initialization files should always + # look in the current directory first. This leads to well-known security +-# and confusion problems, but users insist on it. +-# NOTE: this also affects searching for files named on the command line: +-# see the "File searching" section of Use.htm for full details. +-# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended. ++# and confusion problems, but may be convenient sometimes. + +-SEARCH_HERE_FIRST=1 ++SEARCH_HERE_FIRST=0 + + # Define the name of the interpreter initialization file. + # (There is no reason to change this.) +Index: ghostscript-8.71~dfsg2/base/openvms.mmk +=================================================================== +--- ghostscript-8.71~dfsg2.orig/base/openvms.mmk 2009-01-08 04:17:18.000000000 -0500 ++++ ghostscript-8.71~dfsg2/base/openvms.mmk 2010-12-09 22:01:33.000000000 -0500 +@@ -73,12 +73,9 @@ + + # Define whether or not searching for initialization files should always + # look in the current directory first. This leads to well-known security +-# and confusion problems, but users insist on it. +-# NOTE: this also affects searching for files named on the command line: +-# see the "File searching" section of Use.htm for full details. +-# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended. ++# and confusion problems, but may be convenient sometimes. + +-SEARCH_HERE_FIRST=1 ++SEARCH_HERE_FIRST=0 + + # Define the name of the interpreter initialization file. + # (There is no reason to change this.) +Index: ghostscript-8.71~dfsg2/base/msvclib.mak +=================================================================== +--- ghostscript-8.71~dfsg2.orig/base/msvclib.mak 2010-01-07 05:53:36.000000000 -0500 ++++ ghostscript-8.71~dfsg2/base/msvclib.mak 2010-12-09 22:01:33.000000000 -0500 +@@ -49,13 +49,10 @@ + + # Define whether or not searching for initialization files should always + # look in the current directory first. This leads to well-known security +-# and confusion problems, but users insist on it. +-# NOTE: this also affects searching for files named on the command line: +-# see the "File searching" section of Use.htm for full details. +-# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended. ++# and confusion problems, but may be convenient sometimes. + + !ifndef SEARCH_HERE_FIRST +-SEARCH_HERE_FIRST=1 ++SEARCH_HERE_FIRST=0 + !endif + + # Define the name of the interpreter initialization file. +Index: ghostscript-8.71~dfsg2/base/watcw32.mak +=================================================================== +--- ghostscript-8.71~dfsg2.orig/base/watcw32.mak 2009-11-05 17:24:30.000000000 -0500 ++++ ghostscript-8.71~dfsg2/base/watcw32.mak 2010-12-09 22:01:33.000000000 -0500 +@@ -54,11 +54,8 @@ + # Define whether or not searching for initialization files should always + # look in the current directory first. This leads to well-known security + # and confusion problems, but users insist on it. +-# NOTE: this also affects searching for files named on the command line: +-# see the "File searching" section of Use.htm for full details. +-# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended. + +-SEARCH_HERE_FIRST=1 ++SEARCH_HERE_FIRST=0 + + # Define the name of the interpreter initialization file. + # (There is no reason to change this.) +Index: ghostscript-8.71~dfsg2/base/Makefile.in +=================================================================== +--- ghostscript-8.71~dfsg2.orig/base/Makefile.in 2010-12-09 21:46:33.000000000 -0500 ++++ ghostscript-8.71~dfsg2/base/Makefile.in 2010-12-09 22:01:33.000000000 -0500 +@@ -96,12 +96,9 @@ + + # Define whether or not searching for initialization files should always + # look in the current directory first. This leads to well-known security +-# and confusion problems, but users insist on it. +-# NOTE: this also affects searching for files named on the command line: +-# see the "File searching" section of Use.htm for full details. +-# Because of this, setting SEARCH_HERE_FIRST to 0 is not recommended. ++# and confusion problems, but may be convenient sometimes. + +-SEARCH_HERE_FIRST=1 ++SEARCH_HERE_FIRST=0 + + # Define the name of the interpreter initialization file. + # (There is no reason to change this.) diff -Nru ghostscript-8.71~dfsg2/debian/patches/series ghostscript-8.71~dfsg2/debian/patches/series --- ghostscript-8.71~dfsg2/debian/patches/series 2010-08-19 03:39:52.000000000 -0400 +++ ghostscript-8.71~dfsg2/debian/patches/series 2010-12-09 22:40:06.000000000 -0500 @@ -58,3 +58,5 @@ 1009_fix-build-of-executables.patch 2001_docdir_fix_for_debian.patch 2002_gs_man_fix_debian.patch +1010_CVE-2010-2055_fix-584653.patch +1011_CVE-2010-2055_fix-584663.patch