Date: Mon, 23 Jun 2003 01:19:14 -0400 From: Mike Makonnen <mtm@identd.net> To: freebsd-audit@FreeBSD.Org Cc: Lars Eggert <larse@isi.edu> Subject: Fw: [FreeBSD-rc] mktemp patch Message-ID: <20030623051919.HEOL11703.pop018.verizon.net@kokeb.ambesa.net>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --Multipart_Mon__23_Jun_2003_01:19:14_-0400_08196c00 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hello folks, I don't see any problems with this patch, but I thought I would pass it by this list, since it affects the periodic security scripts. Is there any reason we should specify the template manually instead of using the -t argument to mktemp(1) ? Begin forwarded message: Date: Sat, 21 Jun 2003 10:34:16 -0700 From: Lars Eggert <larse@isi.edu> To: FreeBSD-rc@yahoogroups.com Subject: [FreeBSD-rc] mktemp patch Hi, the attached patch replaces explicit templates with mktemp's -t switch. Lars -- Lars Eggert <larse@isi.edu> USC Information Sciences Institute -- Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | D228 1A6F C64E 120A A1C9 A3AA DAE1 E2AF DBCC 68B9 mtm@FreeBSD.Org| FreeBSD - The Power To Serve --Multipart_Mon__23_Jun_2003_01:19:14_-0400_08196c00 Content-Type: text/plain; name="00000000.mimetmp" Content-Disposition: attachment; filename="00000000.mimetmp" Content-Transfer-Encoding: 7bit Hi, the attached patch replaces explicit templates with mktemp's -t switch. Lars -- Lars Eggert <larse@isi.edu> USC Information Sciences Institute --Multipart_Mon__23_Jun_2003_01:19:14_-0400_08196c00 Content-Type: text/plain; name="mktemp.patch" Content-Disposition: attachment; filename="mktemp.patch" Content-Transfer-Encoding: 7bit Index: periodic/security/500.ipfwdenied =================================================================== RCS file: /home/xbone/CVSROOT/FreeBSD-CURRENT-etc/periodic/security/500.ipfwdenied,v retrieving revision 1.1.1.3 diff -u -r1.1.1.3 500.ipfwdenied --- periodic/security/500.ipfwdenied 26 Oct 2002 20:49:08 -0000 1.1.1.3 +++ periodic/security/500.ipfwdenied 21 Jun 2003 16:20:51 -0000 @@ -41,7 +41,7 @@ case "$daily_status_security_ipfwdenied_enable" in [Yy][Ee][Ss]) - TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` + TMP=`mktemp -t security` if ipfw -a l 2>/dev/null | egrep "deny|reset|unreach" > ${TMP}; then check_diff new_only ipfw ${TMP} "${host} ipfw denied packets:" fi Index: periodic/security/510.ipfdenied =================================================================== RCS file: /home/xbone/CVSROOT/FreeBSD-CURRENT-etc/periodic/security/510.ipfdenied,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 510.ipfdenied --- periodic/security/510.ipfdenied 26 Oct 2002 20:49:08 -0000 1.1.1.1 +++ periodic/security/510.ipfdenied 21 Jun 2003 16:21:10 -0000 @@ -41,7 +41,7 @@ case "$daily_status_security_ipfdenied_enable" in [Yy][Ee][Ss]) - TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` + TMP=`mktemp -t security` if ipfstat -nhio 2>/dev/null | grep block > ${TMP}; then check_diff new_only ipf ${TMP} "${host} ipf denied packets:" fi Index: periodic/security/550.ipfwlimit =================================================================== RCS file: /home/xbone/CVSROOT/FreeBSD-CURRENT-etc/periodic/security/550.ipfwlimit,v retrieving revision 1.1.1.3 diff -u -r1.1.1.3 550.ipfwlimit --- periodic/security/550.ipfwlimit 9 Dec 2002 18:02:54 -0000 1.1.1.3 +++ periodic/security/550.ipfwlimit 21 Jun 2003 16:19:56 -0000 @@ -42,7 +42,7 @@ case "$daily_status_security_ipfwlimit_enable" in [Yy][Ee][Ss]) - TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` + TMP=`mktemp -t security` IPFW_LOG_LIMIT=`sysctl -n net.inet.ip.fw.verbose_limit 2> /dev/null` if [ $? -eq 0 ] && [ "${IPFW_LOG_LIMIT}" -ne 0 ]; then ipfw -a l | grep " log " | \ Index: periodic/security/600.ip6fwdenied =================================================================== RCS file: /home/xbone/CVSROOT/FreeBSD-CURRENT-etc/periodic/security/600.ip6fwdenied,v retrieving revision 1.1.1.3 diff -u -r1.1.1.3 600.ip6fwdenied --- periodic/security/600.ip6fwdenied 26 Oct 2002 20:49:10 -0000 1.1.1.3 +++ periodic/security/600.ip6fwdenied 21 Jun 2003 16:21:29 -0000 @@ -41,7 +41,7 @@ case "$daily_status_security_ip6fwdenied_enable" in [Yy][Ee][Ss]) - TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` + TMP=`mktemp -t security` if ip6fw -a l 2>/dev/null | egrep "deny|reset|unreach" > ${TMP}; then check_diff new_only ip6fw ${TMP} "${host} ip6fw denied packets:" fi Index: periodic/security/650.ip6fwlimit =================================================================== RCS file: /home/xbone/CVSROOT/FreeBSD-CURRENT-etc/periodic/security/650.ip6fwlimit,v retrieving revision 1.1.1.3 diff -u -r1.1.1.3 650.ip6fwlimit --- periodic/security/650.ip6fwlimit 9 Dec 2002 18:02:55 -0000 1.1.1.3 +++ periodic/security/650.ip6fwlimit 21 Jun 2003 16:20:14 -0000 @@ -42,7 +42,7 @@ case "$daily_status_security_ip6fwlimit_enable" in [Yy][Ee][Ss]) - TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` + TMP=`mktemp -t security` IP6FW_LOG_LIMIT=`sysctl -n net.inet6.ip6.fw.verbose_limit 2> /dev/null` if [ $? -eq 0 ] && [ "${IP6FW_LOG_LIMIT}" -ne 0 ]; then ip6fw -a l | grep " log " | \ Index: periodic/security/security.functions =================================================================== RCS file: /home/xbone/CVSROOT/FreeBSD-CURRENT-etc/periodic/security/security.functions,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 security.functions --- periodic/security/security.functions 25 Nov 2002 16:50:15 -0000 1.1.1.2 +++ periodic/security/security.functions 21 Jun 2003 16:20:33 -0000 @@ -52,7 +52,7 @@ msg="$1"; shift if [ "${tmpf}" = "-" ]; then - tmpf=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` + tmpf=`mktemp -t security` cat > ${tmpf} fi Index: rc.d/motd =================================================================== RCS file: /home/xbone/CVSROOT/FreeBSD-CURRENT-etc/rc.d/motd,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 motd --- rc.d/motd 29 Apr 2003 23:34:44 -0000 1.1.1.2 +++ rc.d/motd 21 Jun 2003 16:17:46 -0000 @@ -38,7 +38,7 @@ case ${OSTYPE} in FreeBSD) - T=`mktemp /tmp/_motd.XXXXXX` + T=`mktemp -t motd` uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T} awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T} ;; --Multipart_Mon__23_Jun_2003_01:19:14_-0400_08196c00--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030623051919.HEOL11703.pop018.verizon.net>