From 5d7c39859863230e0e58d83af4b599933cfa23eb Mon Sep 17 00:00:00 2001 From: angelos Date: Fri, 3 Sep 1999 16:40:30 +0000 Subject: [PATCH] Make this compile, remove an tmpname/fopen race. --- mbone/wbd/Makefile | 5 +++-- mbone/wbd/patches/patch-aa | 4 ++-- mbone/wbd/patches/patch-ab | 42 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 mbone/wbd/patches/patch-ab diff --git a/mbone/wbd/Makefile b/mbone/wbd/Makefile index ab1ee3c32ae..9b561b72ea4 100644 --- a/mbone/wbd/Makefile +++ b/mbone/wbd/Makefile @@ -1,6 +1,7 @@ -# $OpenBSD: Makefile,v 1.3 1999/09/02 22:12:39 brad Exp $ +# $OpenBSD: Makefile,v 1.4 1999/09/03 16:40:30 angelos Exp $ -DISTNAME= wbd-1.0ucl4 +DISTNAME= wbd +DISTFILES= wbd-1.0ucl4.tar.gz CATEGORIES= mbone MASTER_SITES= http://www-mice.cs.ucl.ac.uk/multimedia/software/wbd/1.0ucl4/ ONLY_FOR_ARCHS= i386 diff --git a/mbone/wbd/patches/patch-aa b/mbone/wbd/patches/patch-aa index 863552b973b..04e8b02c808 100644 --- a/mbone/wbd/patches/patch-aa +++ b/mbone/wbd/patches/patch-aa @@ -1,5 +1,5 @@ -*** Makefile.orig Thu Jan 29 06:46:41 1998 ---- Makefile Thu Jul 15 10:29:16 1999 +*** makefile.orig Thu Jan 29 06:46:41 1998 +--- makefile Thu Jul 15 10:29:16 1999 *************** *** 3,14 **** diff --git a/mbone/wbd/patches/patch-ab b/mbone/wbd/patches/patch-ab new file mode 100644 index 00000000000..10474bcba2c --- /dev/null +++ b/mbone/wbd/patches/patch-ab @@ -0,0 +1,42 @@ +*** comms.c.orig Fri Sep 3 12:27:47 1999 +--- comms.c Fri Sep 3 12:35:34 1999 +*************** +*** 1260,1266 **** + struct action *action = NULL; + struct pk_draw_msg *message = NULL; + char arg[LEN]; +! char filename[L_tmpnam] = ""; + FILE *tmpfile; + int i, result; + +--- 1260,1266 ---- + struct action *action = NULL; + struct pk_draw_msg *message = NULL; + char arg[LEN]; +! char filename[L_tmpnam] = "wbd.XXXXXXXX"; + FILE *tmpfile; + int i, result; + +*************** +*** 1287,1299 **** + } + + /* Dump the PostScript to a temp file. */ +! if (tmpnam (filename) == NULL) +! { +! printf ("Failed to create temp file.\n"); +! return -1; +! } +! tmpfile = fopen (filename, "wb"); +! if (tmpfile == NULL) + { + printf ("Failed to create temp file.\n"); + return -1; +--- 1287,1293 ---- + } + + /* Dump the PostScript to a temp file. */ +! if ((tmpfile = fdopen(mkstemp(filename), "wb")) == NULL) + { + printf ("Failed to create temp file.\n"); + return -1;