From 2c174a00d20d0984ea1872f7bd1ddbdfb331b461 Mon Sep 17 00:00:00 2001 From: brad Date: Sun, 24 Oct 2004 21:53:02 +0000 Subject: [PATCH] Fix insecure tempfile creation in ps2epsi and pv.sh. http://marc.theaimsgroup.com/?l=bugtraq&m=109655739113230&w=2 --- print/ghostscript/afpl/Makefile | 3 ++- .../ghostscript/afpl/patches/patch-lib_ps2epsi | 12 ++++++++++++ print/ghostscript/afpl/patches/patch-lib_pv_sh | 17 +++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 print/ghostscript/afpl/patches/patch-lib_ps2epsi create mode 100644 print/ghostscript/afpl/patches/patch-lib_pv_sh diff --git a/print/ghostscript/afpl/Makefile b/print/ghostscript/afpl/Makefile index 33be0115ec4..b7624f908b0 100644 --- a/print/ghostscript/afpl/Makefile +++ b/print/ghostscript/afpl/Makefile @@ -1,9 +1,10 @@ -# $OpenBSD: Makefile,v 1.24 2004/09/15 18:32:14 espie Exp $ +# $OpenBSD: Makefile,v 1.25 2004/10/24 21:53:02 brad Exp $ COMMENT= "AFPL PostScript interpreter" VERSION= 8.14 DISTNAME= ghostscript-${VERSION} +PKGNAME= ${DISTNAME}p1 CATEGORIES= print lang DIR= AFPL/gs${VERSION:S/.//} diff --git a/print/ghostscript/afpl/patches/patch-lib_ps2epsi b/print/ghostscript/afpl/patches/patch-lib_ps2epsi new file mode 100644 index 00000000000..af3d34f54df --- /dev/null +++ b/print/ghostscript/afpl/patches/patch-lib_ps2epsi @@ -0,0 +1,12 @@ +$OpenBSD: patch-lib_ps2epsi,v 1.1 2004/10/24 21:53:02 brad Exp $ +--- lib/ps2epsi.orig Sun Oct 24 17:48:10 2004 ++++ lib/ps2epsi Sun Oct 24 17:48:32 2004 +@@ -1,7 +1,7 @@ + #!/bin/sh + # $Id: patch-lib_ps2epsi,v 1.1 2004/10/24 21:53:02 brad Exp $ + +-tmpfile=/tmp/ps2epsi$$ ++tmpfile=`mktemp -t ps2epsiXXXXXXXXXX` || exit 1 + + export outfile + diff --git a/print/ghostscript/afpl/patches/patch-lib_pv_sh b/print/ghostscript/afpl/patches/patch-lib_pv_sh new file mode 100644 index 00000000000..06369f5c7e6 --- /dev/null +++ b/print/ghostscript/afpl/patches/patch-lib_pv_sh @@ -0,0 +1,17 @@ +$OpenBSD: patch-lib_pv_sh,v 1.1 2004/10/24 21:53:02 brad Exp $ +--- lib/pv.sh.orig Thu Feb 21 16:49:28 2002 ++++ lib/pv.sh Sun Oct 24 17:49:36 2004 +@@ -29,9 +29,10 @@ TEMPDIR=. + PAGE=$1 + shift + FILE=$1 ++TEMPFILE=`mktemp -t ${FILE}XXXXXXXXXX` || exit 1 + shift +-trap "rm -rf $TEMPDIR/$FILE.$$.pv" 0 1 2 15 ++trap "rm -rf $TEMPFILE" 0 1 2 15 + #dvips -D$RESOLUTION -p $PAGE -n 1 $FILE $* -o $FILE.$$.pv +-dvips -p $PAGE -n 1 $FILE $* -o $FILE.$$.pv +-gs $FILE.$$.pv ++dvips -p $PAGE -n 1 $FILE $* -o $TEMPFILE ++gs $TEMPFILE + exit 0