aboutsummaryrefslogtreecommitdiff
path: root/devel/libPropList
diff options
context:
space:
mode:
authorMaxim Sobolev <sobomax@FreeBSD.org>2000-06-07 08:39:53 +0000
committerMaxim Sobolev <sobomax@FreeBSD.org>2000-06-07 08:39:53 +0000
commit06785755abc5ddff69fd0d9d030a077f693f70dd (patch)
tree22c654afdbf57075ac9686b1459660874d1d39db /devel/libPropList
parent9eb728a459409099200749906cdc740f7223c4a7 (diff)
downloadports-06785755abc5ddff69fd0d9d030a077f693f70dd.tar.gz
ports-06785755abc5ddff69fd0d9d030a077f693f70dd.zip
Use mkstemp() instean of insecure tmpname().
Notes
Notes: svn path=/head/; revision=29300
Diffstat (limited to 'devel/libPropList')
-rw-r--r--devel/libPropList/Makefile1
-rw-r--r--devel/libPropList/files/patch-ab44
-rw-r--r--devel/libPropList/files/patch-ac11
3 files changed, 56 insertions, 0 deletions
diff --git a/devel/libPropList/Makefile b/devel/libPropList/Makefile
index 24bbe73bd4cb..0e1feeff15bd 100644
--- a/devel/libPropList/Makefile
+++ b/devel/libPropList/Makefile
@@ -15,5 +15,6 @@ DISTNAME= libPropList-${PORTVERSION}
MAINTAINER= sobomax@FreeBSD.org
USE_LIBTOOL= yes
+USE_AUTOCONF= yes
.include <bsd.port.mk>
diff --git a/devel/libPropList/files/patch-ab b/devel/libPropList/files/patch-ab
new file mode 100644
index 000000000000..7b31be14b3f7
--- /dev/null
+++ b/devel/libPropList/files/patch-ab
@@ -0,0 +1,44 @@
+--- filehandling.c.orig Tue Feb 15 03:03:56 2000
++++ filehandling.c Wed Jun 7 01:03:50 2000
+@@ -464,6 +464,7 @@
+
+ if (atomically)
+ {
++#ifndef HAVE_MKSTEMP
+ theFileName = tmpnam(NULL);
+ strcpy(tmp_fileName, theFileName);
+
+@@ -492,14 +493,33 @@
+ }
+
+ theFileName = strcat(dirname, basename);
++#else /* HAVE_MKSTEMP */
++ int fd;
++
++ strcpy(tmp_fileName, "/tmp/tmp.XXXXXX");
++ if ((fd = mkstemp(tmp_fileName)) == -1)
++
++ goto failure; /* Not reached */
++
++ if ((theFile = fdopen(fd, "w+")) == NULL)
++
++ goto failure; /* Not reached */
++
++ theFileName = tmp_fileName;
++#endif
+ }
+ else
+ {
+ theFileName = theRealFileName;
++#ifdef HAVE_MKSTEMP
++ theFile = fopen(theFileName, "w");
++#endif /* HAVE_MKSTEMP */
+ }
+
+ /* Open the file (whether temp or real) for writing. */
++#ifndef HAVE_MKSTEMP
+ theFile = fopen(theFileName, "w");
++#endif /* ! HAVE_MKSTEMP */
+
+ if (theFile == NULL) /* Something went wrong; we weren't
+ * even able to open the file. */
diff --git a/devel/libPropList/files/patch-ac b/devel/libPropList/files/patch-ac
new file mode 100644
index 000000000000..77b6877daf8a
--- /dev/null
+++ b/devel/libPropList/files/patch-ac
@@ -0,0 +1,11 @@
+--- work/libPropList-0.10.1/configure.in Sun Apr 2 00:41:39 2000
++++ configure.in Wed Jun 7 00:39:07 2000
+@@ -42,7 +42,7 @@
+ AC_FUNC_MEMCMP
+ AC_TYPE_SIGNAL
+
+-AC_CHECK_FUNCS(gethostname gettimeofday mkdir rmdir select strstr)
++AC_CHECK_FUNCS(gethostname gettimeofday mkdir mkstemp rmdir select strstr)
+
+ AC_CHECK_FUNC(socket,,
+ AC_CHECK_LIB(socket, socket, XTRALIBS="$XTRALIBS -lsocket",))