Fix insecure tempfile creation in etc2ps.

http://marc.theaimsgroup.com/?l=bugtraq&m=109655739113230&w=2
This commit is contained in:
brad 2004-10-24 20:26:55 +00:00
parent e54a358bb4
commit 4affd83ea1
2 changed files with 19 additions and 1 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.5 2003/08/22 11:18:19 naddy Exp $
# $OpenBSD: Makefile,v 1.6 2004/10/24 20:26:55 brad Exp $
COMMENT= "AFP file and print services for AppleTalk/IP networks"
DISTNAME= netatalk-1.6.3
PKGNAME= ${DISTNAME}p1
CATEGORIES= net
HOMEPAGE= http://netatalk.sourceforge.net/

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-etc_psf_etc2ps_sh,v 1.1 2004/10/24 20:26:55 brad Exp $
--- etc/psf/etc2ps.sh.orig Sun Oct 24 16:20:53 2004
+++ etc/psf/etc2ps.sh Sun Oct 24 16:23:22 2004
@@ -26,9 +26,10 @@ case $1 in
#
df*)
if [ -x "$DVIPS" ]; then
- cat > /tmp/psfilter.$$
- $DVIPS $DVIPSARGS < /tmp/psfilter.$$
- rm -f /tmp/psfilter.$$
+ TEMPFILE=`mktemp -t psfilter.XXXXXXXXXX` || exit 1
+ cat > $TEMPFILE
+ $DVIPS $DVIPSARGS < $TEMPFILE
+ rm -f $TEMPFILE
else
echo "$0: filter dvips uninstalled" 1>&2
exit 2