diff options
author | sobomax <sobomax@FreeBSD.org> | 2000-06-09 15:23:48 +0800 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2000-06-09 15:23:48 +0800 |
commit | 5bdf8f2a811ccf30f3aaab9fe3cdc36febb73894 (patch) | |
tree | 3ce1b5b934cf9a689fb2774e0218f3e3da63abd0 /net-mgmt/arpwatch | |
parent | 4090134dd8fd9161bd7870de48b4373ca2e133f3 (diff) | |
download | freebsd-ports-gnome-5bdf8f2a811ccf30f3aaab9fe3cdc36febb73894.tar.gz freebsd-ports-gnome-5bdf8f2a811ccf30f3aaab9fe3cdc36febb73894.tar.zst freebsd-ports-gnome-5bdf8f2a811ccf30f3aaab9fe3cdc36febb73894.zip |
Use mkstemp() instead of insecure mktemp().
PR: 19047
Hall of Shame entry: Mikhail Teterin <mi@aldan.algebra.com> (for his !@#$%^ ego)
Diffstat (limited to 'net-mgmt/arpwatch')
-rw-r--r-- | net-mgmt/arpwatch/files/patch-ad | 29 | ||||
-rw-r--r-- | net-mgmt/arpwatch/files/patch-ae | 29 |
2 files changed, 58 insertions, 0 deletions
diff --git a/net-mgmt/arpwatch/files/patch-ad b/net-mgmt/arpwatch/files/patch-ad new file mode 100644 index 000000000000..02096d9d63bf --- /dev/null +++ b/net-mgmt/arpwatch/files/patch-ad @@ -0,0 +1,29 @@ +--- report.c.orig Fri Jun 9 09:54:48 2000 ++++ report.c Fri Jun 9 10:05:58 2000 +@@ -249,6 +249,9 @@ + char *unknown = "<unknown>"; + char buf[132]; + static int init = 0; ++#ifdef HAVE_MKSTEMP ++ int fd; ++#endif + + /* No report until we're initialized */ + if (initializing) +@@ -286,8 +289,16 @@ + /* Child */ + closelog(); + (void)strcpy(tempfile, "/tmp/arpwatch.XXXXXX"); ++#ifndef HAVE_MKSTEMP + (void)mktemp(tempfile); + if ((f = fopen(tempfile, "w+")) == NULL) { ++#else ++ if ((fd = mkstemp(tempfile)) == -1) { ++ syslog(LOG_ERR, "child mkstemp(%s): %m", tempfile); ++ exit(1); ++ } ++ if ((f = fdopen(fd, "w+")) == NULL) { ++#endif /* HAVE_MKSTEMP */ + syslog(LOG_ERR, "child open(%s): %m", tempfile); + exit(1); + } diff --git a/net-mgmt/arpwatch/files/patch-ae b/net-mgmt/arpwatch/files/patch-ae new file mode 100644 index 000000000000..64ebc59f69e2 --- /dev/null +++ b/net-mgmt/arpwatch/files/patch-ae @@ -0,0 +1,29 @@ +--- configure.orig Wed Jul 29 08:16:52 1998 ++++ configure Fri Jun 9 10:12:32 2000 +@@ -646,7 +646,7 @@ + : + fi + +- V_CCOPT="-O" ++# V_CCOPT="-O" + V_INCLS="" + if test "${srcdir}" != "." ; then + V_INCLS="-I\$\(srcdir\)" +@@ -887,7 +887,7 @@ + + echo "$ac_t""$ac_cv_lbl_gcc_vers" 1>&6 + if test $ac_cv_lbl_gcc_vers -gt 1 ; then +- V_CCOPT="-O2" ++# V_CCOPT="-O2" + fi + fi + else +@@ -1154,7 +1154,7 @@ + fi + + +-for ac_func in dn_skipname ++for ac_func in dn_skipname mkstemp + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 + echo "configure:1161: checking for $ac_func" >&5 |