aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2017-05-30 13:38:46 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2017-05-30 13:38:46 +0000
commit84d9d1ac4496bf8360a8e717152bb81419d7e989 (patch)
tree99dd03d24eb0ed789d320c1452315d6c5fd6dd4e
parent6916b57a3b0b5200fbcd5f6b22a9d21bbe9098d6 (diff)
downloadaports-84d9d1ac4496bf8360a8e717152bb81419d7e989.tar.bz2
aports-84d9d1ac4496bf8360a8e717152bb81419d7e989.tar.xz
main/ghostscript: security upgrade (CVE-2017-5951, CVE-2017-7207, CVE-2017-8291). Fixes #7313
-rw-r--r--main/ghostscript/APKBUILD61
-rw-r--r--main/ghostscript/CVE-2017-5951.patch39
-rw-r--r--main/ghostscript/CVE-2017-7207.patch33
-rw-r--r--main/ghostscript/CVE-2017-8291.patch60
-rw-r--r--main/ghostscript/fix-sprintf.patch58
-rw-r--r--main/ghostscript/ghostscript-system-openjpeg2.patch60
-rw-r--r--main/ghostscript/ghostscript-system-zlib.patch35
7 files changed, 182 insertions, 164 deletions
diff --git a/main/ghostscript/APKBUILD b/main/ghostscript/APKBUILD
index 7e2a09f667..a7f7686c53 100644
--- a/main/ghostscript/APKBUILD
+++ b/main/ghostscript/APKBUILD
@@ -1,8 +1,8 @@
# Contributor: Cameron Banta <cbanta@gmail.com>
# Maintainer: Cameron Banta <cbanta@gmail.com>
pkgname=ghostscript
-pkgver=9.16
-pkgrel=2
+pkgver=9.21
+pkgrel=0
pkgdesc="An interpreter for the PostScript language and for PDF"
url="http://ghostscript.com/"
arch="all"
@@ -11,15 +11,19 @@ makedepends="autoconf automake libjpeg-turbo-dev libpng-dev jasper-dev expat-dev
zlib-dev tiff-dev freetype-dev lcms2-dev gtk+3.0-dev
cups-dev libtool jbig2dec-dev openjpeg-dev"
subpackages="$pkgname-doc $pkgname-dev $pkgname-gtk"
-source="http://downloads.ghostscript.com/public/$pkgname-$pkgver.tar.gz
+source="https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${pkgver/./}/ghostscript-$pkgver.tar.gz
ghostscript-system-zlib.patch
- ghostscript-system-openjpeg2.patch
- ghostscript-wrf-snprintf.patch
fix-sprintf.patch
- CVE-2015-3228.patch
fix-alignment.patch
- fix-libopenjp-static.patch
+ CVE-2017-8291.patch
+ CVE-2017-7207.patch
+ CVE-2017-5951.patch
"
+# secfixes:
+# 9.21-r0:
+# - CVE-2017-8291
+# - CVE-2017-7207
+# - CVE-2017-5951
_builddir="$srcdir/ghostscript-$pkgver"
prepare() {
@@ -31,8 +35,8 @@ prepare() {
done
# force it to use system-libs
- rm -r jpeg libpng zlib expat tiff lcms2 cups/libs jbig2dec \
- freetype openjpeg || return 1
+ rm -r jpeg libpng zlib tiff lcms2 cups/libs jbig2dec \
+ freetype || return 1
# fix parallel builds
sed -i -e 's/ECHO_XE/ECHOGS_XE/g' \
@@ -113,27 +117,24 @@ gtk() {
mv "$pkgdir"/usr/bin/gsx "$subpkgdir"/usr/bin/
}
-md5sums="829319325bbdb83f5c81379a8f86f38f ghostscript-9.16.tar.gz
-c180cac458c6ab7bcd319fe092abb9cd ghostscript-system-zlib.patch
-7bc12888cccf6d2827d0ff012813220f ghostscript-system-openjpeg2.patch
-f5129f6cc01a3d593cf02fe1ef94cbe8 ghostscript-wrf-snprintf.patch
-ed14fa288463e08e1e6074a5d1ebbcbb fix-sprintf.patch
-27971c7530ffd4e4046d1ffb61cac13d CVE-2015-3228.patch
+md5sums="5f213281761d2750fcf27476c404d17f ghostscript-9.21.tar.gz
+ae582371ec56fd8f73349773f23dcc94 ghostscript-system-zlib.patch
+ee7da55d7a714db1de0fa78253cdacf3 fix-sprintf.patch
5ebdebe1e22a6eb1b7ebbf3e89c55314 fix-alignment.patch
-a6f6d40d785617b14f0d32d6650d24e0 fix-libopenjp-static.patch"
-sha256sums="746d77280cca8afdd3d4c2c1389e332ed9b0605bd107bcaae1d761b061d1a68d ghostscript-9.16.tar.gz
-bcbd4154fc186b3564fa6140d57117f243a5d703823c03443434c09aeef20684 ghostscript-system-zlib.patch
-0d029c98b2149715b63d2eae9634eca0d427bf77e713dd355854412fc92b35ac ghostscript-system-openjpeg2.patch
-3ca8f75d743aae7f2baa109a2a9217c33867c13e88e0ddbc96dc9be39157ae72 ghostscript-wrf-snprintf.patch
-3051dff937ab9ced9f88b36384400b10bc9cdb39b2abd3ece8f4c41a0246874e fix-sprintf.patch
-e6407cc5d74b6963242efec942c92b093a076c835451e6b949417b85d24c85d1 CVE-2015-3228.patch
+e5256008d310f555b82bfaff807664b0 CVE-2017-8291.patch
+0cea86a2d25001619e071e5d00b6925e CVE-2017-7207.patch
+a5e14e9089a52307f02a58f994817903 CVE-2017-5951.patch"
+sha256sums="02bceadbc4dddeb6f2eec9c8b1623d945d355ca11b8b4df035332b217d58ce85 ghostscript-9.21.tar.gz
+56662fae7956e741059ef9c2b5a7e883ab04d78acf5dae4fddf4a661f47f8b67 ghostscript-system-zlib.patch
+6e01bd26ade307414f86a5d8f00c97719830d8afd49ffe84224ae47498de7a54 fix-sprintf.patch
22262be45ba77db5508e60cb2eef7f78178b9a38bfbfbb85d4082d4d7a2c1710 fix-alignment.patch
-1fefc3e2de4bb969e168bc1cda950d5adc0374e8857b91068985d13bd8087cc4 fix-libopenjp-static.patch"
-sha512sums="cd7da12f55379f7d388bd2573a307426da230a2220766a7138ab49990fb34343801a6d5e76ba0f4d6c97a5871359658ca043fcc700242b02f30de30a15b2847f ghostscript-9.16.tar.gz
-6449fe3594d2b61aa4a96762a91db847242dbbb407c6743af8a5db0f7f18bb82df3c89e974e6b23deecaaf7b6bf1fb6930713cbe6229ec3d8b26dd65115893a8 ghostscript-system-zlib.patch
-f874540fc53f85a3587253aaf8a29fc7792590938daf7f44e573cbbdac258b39db8baccce9569737c5c1a0a3816c6a8ff55b97f60dbefbba0c1729fd202d0ddd ghostscript-system-openjpeg2.patch
-86f30dd61c4ee87e1cf72686da4ee6d0dd89100e122279c038dd7cb813a72b95d170ca2ae8cf6a10f2a01b18e49c704dc6aca5cbb5253886908332a90b7a7c2b ghostscript-wrf-snprintf.patch
-300712709ec75f728c703f6a2a5abd992b7c2137df81cc1dd4f6e96c690077e0d5a4afd0e06ce55660061911ddfbf1e68d7020ec3e5f2124602133a10451ec42 fix-sprintf.patch
-142772a600d69e48e2a58d84ebf08fb89a8794cfa0424b81f35b7bb99399a07ed2bbfb2a2e7c60663f3e8cfcc223c04c23433cb81a3ab5dbd59cd8252f930367 CVE-2015-3228.patch
+366bf4ded600fc7b0a8e2b0d4c877cc3ad5a0ccc192cb660d81f729575a47259 CVE-2017-8291.patch
+641007b64e047cd20e439a77d16b9425f229b564fb5520875a4f0a03d53154e5 CVE-2017-7207.patch
+2dd876cd8c97c52b098dbb36bbdcb761476d9d8c4fb75b177f1a3f63de4533a2 CVE-2017-5951.patch"
+sha512sums="c5ff632dc9b418ebeecaae796cecbaf9ffcb84d7a1b62c1af2e6c9082f7b9f24fe9dd9f6a57bde3640f54c3036f0b99b32aac9f8ca1f489c012369ab2b72ae92 ghostscript-9.21.tar.gz
+70721e3a335afa5e21d4e6cf919119010bd4544a03ab8f53f5325c173902221ad9b88c118b4bfeee80b3e1956bcdbaf4c53f64ae7fb81f5ba57dbc956750c482 ghostscript-system-zlib.patch
+beefcf395f7f828e1b81c088022c08a506e218f27535b9de01e0f0edf7979b435316c318fa676771630f6ad16ff1ab059cd68aa128ed97e5a9f2f3fa840200c4 fix-sprintf.patch
7c6f40217dc687df27ee6d33351fba12a737c2ae06d1c35208dc943776d8efa66c3e882f0b1b9aec566fad69fd28ce360cc243f1c1aa20834467e769889194f2 fix-alignment.patch
-53cff34a9b5eda8241bb1835913cb10e44ad4077495b3e26953b00c95aae0019e6a177c6ecb138bd57f68867445deb53bd83df2ba3d530f7f25d1ca1b0295b21 fix-libopenjp-static.patch"
+c17121e564dd26033508199f3e587bfcee5589fec6e45e822c79f648c3a3b70363f04ad33538070c4d24c96e5795b277345359b66d2f360b996fca77239102b5 CVE-2017-8291.patch
+11ece0df5d5d5ae6d654033c42531a82db57a92aed462659d177e18234cf6d61719625368eb4448a2235bca9d6b3901696b30099642c57df57966def5850da9d CVE-2017-7207.patch
+252d826bdf1e22c372312589e9b19067332c432eae748f2eb644bf32384925e8095ea7c218ca7bbf04bf384db42cca6b418cb6622a74d411da446776490516d8 CVE-2017-5951.patch"
diff --git a/main/ghostscript/CVE-2017-5951.patch b/main/ghostscript/CVE-2017-5951.patch
new file mode 100644
index 0000000000..c419e0653b
--- /dev/null
+++ b/main/ghostscript/CVE-2017-5951.patch
@@ -0,0 +1,39 @@
+From bfa6b2ecbe48edc69a7d9d22a12419aed25960b8 Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Thu, 6 Apr 2017 16:44:54 +0100
+Subject: [PATCH] Bug 697548: use the correct param list enumerator
+
+When we encountered dictionary in a ref_param_list, we were using the enumerator
+for the "parent" param_list, rather than the enumerator for the param_list
+we just created for the dictionary. That parent was usually the stack
+list enumerator, and caused a segfault.
+
+Using the correct enumerator works better.
+---
+ psi/iparam.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/psi/iparam.c b/psi/iparam.c
+index 4e63b6d..b2fa85f 100644
+--- a/psi/iparam.c
++++ b/psi/iparam.c
+@@ -770,12 +770,13 @@ ref_param_read_typed(gs_param_list * plist, gs_param_name pkey,
+ gs_param_enumerator_t enumr;
+ gs_param_key_t key;
+ ref_type keytype;
++ dict_param_list *dlist = (dict_param_list *) pvalue->value.d.list;
+
+ param_init_enumerator(&enumr);
+- if (!(*((iparam_list *) plist)->enumerate)
+- ((iparam_list *) pvalue->value.d.list, &enumr, &key, &keytype)
++ if (!(*(dlist->enumerate))
++ ((iparam_list *) dlist, &enumr, &key, &keytype)
+ && keytype == t_integer) {
+- ((dict_param_list *) pvalue->value.d.list)->int_keys = 1;
++ dlist->int_keys = 1;
+ pvalue->type = gs_param_type_dict_int_keys;
+ }
+ }
+--
+2.9.1
+
diff --git a/main/ghostscript/CVE-2017-7207.patch b/main/ghostscript/CVE-2017-7207.patch
new file mode 100644
index 0000000000..0cfa5942be
--- /dev/null
+++ b/main/ghostscript/CVE-2017-7207.patch
@@ -0,0 +1,33 @@
+From 309eca4e0a31ea70dcc844812691439312dad091 Mon Sep 17 00:00:00 2001
+From: Ken Sharp <ken.sharp@artifex.com>
+Date: Mon, 20 Mar 2017 09:34:11 +0000
+Subject: [PATCH] Ensure a device has raster memory, before trying to read it.
+
+Bug #697676 "Null pointer dereference in mem_get_bits_rectangle()"
+
+This is only possible by abusing/mis-using Ghostscript-specific
+language extensions, so cannot happen in a general PostScript program.
+
+Nevertheless, Ghostscript should not crash. So this commit checks the
+memory device to see if raster memory has been allocated, before trying
+to read from it.
+---
+ base/gdevmem.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/base/gdevmem.c b/base/gdevmem.c
+index afd05bd..d52d684 100644
+--- a/base/gdevmem.c
++++ b/base/gdevmem.c
+@@ -606,6 +606,8 @@ mem_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect,
+ GB_PACKING_CHUNKY | GB_COLORS_NATIVE | GB_ALPHA_NONE;
+ return_error(gs_error_rangecheck);
+ }
++ if (mdev->line_ptrs == 0x00)
++ return_error(gs_error_rangecheck);
+ if ((w <= 0) | (h <= 0)) {
+ if ((w | h) < 0)
+ return_error(gs_error_rangecheck);
+--
+2.9.1
+
diff --git a/main/ghostscript/CVE-2017-8291.patch b/main/ghostscript/CVE-2017-8291.patch
new file mode 100644
index 0000000000..83f3b4fcc5
--- /dev/null
+++ b/main/ghostscript/CVE-2017-8291.patch
@@ -0,0 +1,60 @@
+From 04b37bbce174eed24edec7ad5b920eb93db4d47d Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Thu, 27 Apr 2017 13:21:31 +0100
+Subject: [PATCH] Bug 697799: have .rsdparams check its parameters
+
+The Ghostscript internal operator .rsdparams wasn't checking the number or
+type of the operands it was being passed. Do so.
+---
+ psi/zfrsd.c | 22 +++++++++++++++-------
+ 1 file changed, 15 insertions(+), 7 deletions(-)
+
+diff --git a/psi/zfrsd.c b/psi/zfrsd.c
+index 191107d..950588d 100644
+--- a/psi/zfrsd.c
++++ b/psi/zfrsd.c
+@@ -49,13 +49,20 @@ zrsdparams(i_ctx_t *i_ctx_p)
+ ref *pFilter;
+ ref *pDecodeParms;
+ int Intent = 0;
+- bool AsyncRead;
++ bool AsyncRead = false;
+ ref empty_array, filter1_array, parms1_array;
+ uint i;
+- int code;
++ int code = 0;
++
++ if (ref_stack_count(&o_stack) < 1)
++ return_error(gs_error_stackunderflow);
++ if (!r_has_type(op, t_dictionary) && !r_has_type(op, t_null)) {
++ return_error(gs_error_typecheck);
++ }
+
+ make_empty_array(&empty_array, a_readonly);
+- if (dict_find_string(op, "Filter", &pFilter) > 0) {
++ if (r_has_type(op, t_dictionary)
++ && dict_find_string(op, "Filter", &pFilter) > 0) {
+ if (!r_is_array(pFilter)) {
+ if (!r_has_type(pFilter, t_name))
+ return_error(gs_error_typecheck);
+@@ -94,12 +101,13 @@ zrsdparams(i_ctx_t *i_ctx_p)
+ return_error(gs_error_typecheck);
+ }
+ }
+- code = dict_int_param(op, "Intent", 0, 3, 0, &Intent);
++ if (r_has_type(op, t_dictionary))
++ code = dict_int_param(op, "Intent", 0, 3, 0, &Intent);
+ if (code < 0 && code != gs_error_rangecheck) /* out-of-range int is ok, use 0 */
+ return code;
+- if ((code = dict_bool_param(op, "AsyncRead", false, &AsyncRead)) < 0
+- )
+- return code;
++ if (r_has_type(op, t_dictionary))
++ if ((code = dict_bool_param(op, "AsyncRead", false, &AsyncRead)) < 0)
++ return code;
+ push(1);
+ op[-1] = *pFilter;
+ if (pDecodeParms)
+--
+2.9.1
+
diff --git a/main/ghostscript/fix-sprintf.patch b/main/ghostscript/fix-sprintf.patch
index a37303ef6c..5a06af5620 100644
--- a/main/ghostscript/fix-sprintf.patch
+++ b/main/ghostscript/fix-sprintf.patch
@@ -1,56 +1,8 @@
---- ./cups/gdevcups.c.orig
-+++ ./cups/gdevcups.c
-@@ -1042,7 +1042,7 @@
-
- for (i = 0; i < 16; i ++)
- {
-- sprintf(name, "cupsInteger%d", i);
-+ snprintf(name, sizeof(name), "cupsInteger%d", i);
- if ((code = param_write_int(plist, strdup(name),
- (int *)(cups->header.cupsInteger + i))) < 0)
- return (code);
-@@ -1050,7 +1050,7 @@
-
- for (i = 0; i < 16; i ++)
- {
-- sprintf(name, "cupsReal%d", i);
-+ snprintf(name, sizeof(name), "cupsReal%d", i);
- if ((code = param_write_float(plist, strdup(name),
- cups->header.cupsReal + i)) < 0)
- return (code);
-@@ -1058,7 +1058,7 @@
-
- for (i = 0; i < 16; i ++)
- {
-- sprintf(name, "cupsString%d", i);
-+ snprintf(name, sizeof(name), "cupsString%d", i);
- param_string_from_transient_string(s, cups->header.cupsString[i]);
- if ((code = param_write_string(plist, strdup(name), &s)) < 0)
- return (code);
-@@ -3184,19 +3184,19 @@
-
- for (i = 0; i < 16; i ++)
- {
-- sprintf(name, "cupsInteger%d", i);
-+ snprintf(name, sizeof(name), "cupsInteger%d", i);
- intoption(cupsInteger[i],strdup(name), unsigned)
- }
-
- for (i = 0; i < 16; i ++)
- {
-- sprintf(name, "cupsReal%d", i);
-+ snprintf(name, sizeof(name), "cupsReal%d", i);
- floatoption(cupsReal[i], strdup(name))
- }
-
- for (i = 0; i < 16; i ++)
- {
-- sprintf(name, "cupsString%d", i);
-+ snprintf(name, sizeof(name), "cupsString%d", i);
- stringoption(cupsString[i], strdup(name))
- }
-
-@@ -4271,10 +4271,10 @@
+diff --git a/cups/gdevcups.c b/cups/gdevcups.c
+index c00e758..35b4035 100644
+--- a/cups/gdevcups.c
++++ b/cups/gdevcups.c
+@@ -4353,10 +4353,10 @@ cups_set_color_info(gx_device *pdev) /* I - Device info */
*/
if (pdev->HWResolution[0] != pdev->HWResolution[1])
diff --git a/main/ghostscript/ghostscript-system-openjpeg2.patch b/main/ghostscript/ghostscript-system-openjpeg2.patch
deleted file mode 100644
index 51185224f0..0000000000
--- a/main/ghostscript/ghostscript-system-openjpeg2.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff -up ghostscript-9.16/base/openjpeg.mak.system-openjpeg2 ghostscript-9.16/base/openjpeg.mak
---- ghostscript-9.16/base/openjpeg.mak.system-openjpeg2 2015-03-30 09:21:24.000000000 +0100
-+++ ghostscript-9.16/base/openjpeg.mak 2015-03-30 17:05:55.160034798 +0100
-@@ -16,6 +16,7 @@
- # makefile for Luratech lwf_jp2 library code.
- # Users of this makefile must define the following:
- # SHARE_JPX - whether to compile in or link to the library
-+# SHARE_JPX_LIB - name of external library to link to
- # JPXSRCDIR - the library source directory
- #
- # gs.mak and friends define the following:
-@@ -105,7 +106,7 @@ $(OPEN_JPEG_GEN)openjpeg.dev : $(TOP_MAK
- # external link .dev
- $(OPEN_JPEG_GEN)openjpeg_1.dev : $(TOP_MAKEFILES) $(OPEN_JPEG_MAK) $(ECHOGS_XE) \
- $(MAKEDIRS)
-- $(SETMOD) $(OPEN_JPEG_GEN)openjpeg_1 -lib lib_openjpeg
-+ $(SETMOD) $(OPEN_JPEG_GEN)openjpeg_1 -lib $(SHARE_JPX_LIB)
-
- # compile our own .dev
- $(OPEN_JPEG_GEN)openjpeg_0.dev : $(TOP_MAKEFILES) $(OPEN_JPEG_MAK) $(ECHOGS_XE) $(open_jpeg_OBJS) \
-diff -up ghostscript-9.16/configure.ac.system-openjpeg2 ghostscript-9.16/configure.ac
---- ghostscript-9.16/configure.ac.system-openjpeg2 2015-03-30 09:21:24.000000000 +0100
-+++ ghostscript-9.16/configure.ac 2015-03-30 17:05:08.563193858 +0100
-@@ -1531,6 +1531,17 @@ if test "x$JPX_DECODER" = "x"; then
- JPXDEVS='$(PSD)jpx.dev'
- else
- AC_MSG_RESULT([no])
-+ AC_MSG_CHECKING([for system OpenJPEG library])
-+ if $PKGCONFIG --exists libopenjp2; then
-+ AC_MSG_RESULT(yes)
-+ JPX_DECODER=openjpeg
-+ SHARE_JPX=1
-+ SHARE_JPX_LIB="`$PKGCONFIG libopenjp2 --libs | sed -e 's,^-l,,'`"
-+ JPX_AUTOCONF_CFLAGS="-DUSE_OPENJPEG_JP2 `$PKGCONFIG libopenjp2 --cflags`"
-+ JPXDEVS='$(PSD)jpx.dev'
-+ else
-+ AC_MSG_RESULT(no)
-+ fi
- fi
- fi
- fi
-@@ -1539,6 +1550,7 @@ AC_SUBST(JPX_DECODER)
- AC_SUBST(JPX_AUTOCONF_CFLAGS)
- AC_SUBST(JPXDIR)
- AC_SUBST(SHARE_JPX)
-+AC_SUBST(SHARE_JPX_LIB)
- AC_SUBST(JPXDEVS)
-
- dnl check if we can/should build the gtk loader
-diff -up ghostscript-9.16/Makefile.in.system-openjpeg2 ghostscript-9.16/Makefile.in
---- ghostscript-9.16/Makefile.in.system-openjpeg2 2015-03-30 17:02:51.000000000 +0100
-+++ ghostscript-9.16/Makefile.in 2015-03-30 17:05:08.563193858 +0100
-@@ -248,6 +248,7 @@ JBIG2_CFLAGS=@JBIG2_AUTOCONF_CFLAGS@
- # and source location and configuration flags for compiling in
- JPX_LIB=@JPX_DECODER@
- SHARE_JPX=@SHARE_JPX@
-+SHARE_JPX_LIB=@SHARE_JPX_LIB@
- JPXSRCDIR=@JPXDIR@
- JPX_CFLAGS=@JPX_AUTOCONF_CFLAGS@
-
diff --git a/main/ghostscript/ghostscript-system-zlib.patch b/main/ghostscript/ghostscript-system-zlib.patch
index ef1e3ac17e..ed6e42da32 100644
--- a/main/ghostscript/ghostscript-system-zlib.patch
+++ b/main/ghostscript/ghostscript-system-zlib.patch
@@ -1,21 +1,14 @@
-diff -up ghostscript-9.16/devices/devs.mak.system-zlib ghostscript-9.16/devices/devs.mak
---- ghostscript-9.16/devices/devs.mak.system-zlib 2015-03-30 17:47:57.931725800 +0100
-+++ ghostscript-9.16/devices/devs.mak 2015-03-30 17:48:14.539673024 +0100
-@@ -1231,7 +1231,7 @@ $(libtiff_dev) $(MAKEDIRS)
-
- $(DEVOBJ)gdevxps.$(OBJ) : $(DEVVECSRC)gdevxps.c $(gdevvec_h) \
- $(string__h) $(stdio__h) $(libtiff_dev) $(gx_h) $(gserrors_h) \
--$(gxpath_h) $(gzcpath_h) $(stream_h) $(zlib_h) \
-+$(gxpath_h) $(gzcpath_h) $(stream_h) \
- $(stdint__h) $(gdevtifs_h) $(gsicc_create_h) $(gsicc_cache_h) \
- $(gximdecode_h) $(MAKEDIRS)
- $(XPSDEVCC) $(I_)$(TI_)$(_I) $(GLO_)gdevxps.$(OBJ) $(C_) $(DEVVECSRC)gdevxps.c
-@@ -1683,7 +1683,7 @@ $(DD)pngalpha.dev : $(DEVS_MAK) $(libpng
- fpng_=$(DEVOBJ)gdevfpng.$(OBJ) $(DEVOBJ)gdevpccm.$(OBJ)
-
- $(DEVOBJ)gdevfpng_0.$(OBJ) : $(DEVSRC)gdevfpng.c\
-- $(gdevprn_h) $(gdevpccm_h) $(gscdefs_h) $(zlib_h) $(MAKEDIRS)
-+ $(gdevprn_h) $(gdevpccm_h) $(gscdefs_h) $(MAKEDIRS)
- $(CC_) $(I_)$(DEVI_) $(II)$(PI_)$(_I) $(PCF_) $(GLF_) $(DEVO_)gdevfpng_0.$(OBJ) $(C_) $(DEVSRC)gdevfpng.c
-
- $(DEVOBJ)gdevfpng_1.$(OBJ) : $(DEVSRC)gdevfpng.c\
+diff --git a/base/lib.mak b/base/lib.mak
+index e8ee4e7..4abaa05 100644
+--- a/base/lib.mak
++++ b/base/lib.mak
+@@ -589,7 +589,9 @@ srlx_h=$(GLSRC)srlx.h
+ sstring_h=$(GLSRC)sstring.h
+ strimpl_h=$(GLSRC)strimpl.h $(scommon_h) $(gstypes_h) $(gsstruct_h)
+ szlibx_h=$(GLSRC)szlibx.h
++ifneq ($(SHARE_ZLIB),1)
+ zlib_h=$(ZSRCDIR)$(D)zlib.h
++endif
+ # We have two of the following, for shared zlib (_1)
+ # and 'local' zlib (_0)
+ szlibxx_h_1=$(GLSRC)szlibxx.h $(szlibx_h)