summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFoxfair Hu <foxfair@FreeBSD.org>2003-05-21 15:40:40 +0000
committerFoxfair Hu <foxfair@FreeBSD.org>2003-05-21 15:40:40 +0000
commita01ac766fb8800e4344fdd16144cfbb53e6ea8b2 (patch)
tree6361d3f775e08840c66e460e0622fb343ebd0e07
parentReflect renaming Net-BGP to Net-BGP4. (diff)
PR: 52098
Submitted by: Jim Geovedi <jim@corebsd.or.id> close temp file privledge problem in security/fuzz.
Notes
Notes: svn path=/head/; revision=81624
-rw-r--r--security/fuzz/Makefile1
-rw-r--r--security/fuzz/files/patch-fuzz.c20
2 files changed, 21 insertions, 0 deletions
diff --git a/security/fuzz/Makefile b/security/fuzz/Makefile
index f5f479c746ce..c934ac0c32c8 100644
--- a/security/fuzz/Makefile
+++ b/security/fuzz/Makefile
@@ -7,6 +7,7 @@
PORTNAME= fuzz
PORTVERSION= 0.6
+PORTREVISION= 1
CATEGORIES= security
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= fuzz
diff --git a/security/fuzz/files/patch-fuzz.c b/security/fuzz/files/patch-fuzz.c
new file mode 100644
index 000000000000..ba229134bd9d
--- /dev/null
+++ b/security/fuzz/files/patch-fuzz.c
@@ -0,0 +1,20 @@
+--- fuzz.c.orig Mon May 12 01:49:39 2003
++++ fuzz.c Mon May 12 01:53:44 2003
+@@ -387,10 +387,16 @@
+ int progpipe[2],status;
+ char sendnewline=0;
+ unsigned long curchar=0,linelen=0;
++ int fd;
+
+ // finish setting up files
+ if(!execute_filename){
+- snprintf(outfilename,MAXPATH,"/tmp%s.%lu",strrchr(progname,'/'),runs);
++ snprintf(outfilename,MAXPATH,"/tmp%s.%lu.XXXXXX",strrchr(progname,'/'),runs);
++ if ((fd=mkstemp(outfilename)) < 0) {
++ perror("Unable to create temporary file");
++ abort();
++ }
++ close(fd);
+ if((outfile=fopen(outfilename,"w"))==NULL){
+ fprintf(stderr,"Can't fopen outfile.\n");
+ abort();