diff options
author | cjc <cjc@FreeBSD.org> | 2002-08-25 04:09:17 +0000 |
---|---|---|
committer | cjc <cjc@FreeBSD.org> | 2002-08-25 04:09:17 +0000 |
commit | 1bdbc52de73cf71badcb2564c142d3bd1b49eada (patch) | |
tree | 5c6bebf0979e515438921a9fe4a7177081994353 | |
parent | dd7bfe512b7208756388162f0bd728e5ae1af875 (diff) | |
download | FreeBSD-src-1bdbc52de73cf71badcb2564c142d3bd1b49eada.zip FreeBSD-src-1bdbc52de73cf71badcb2564c142d3bd1b49eada.tar.gz |
Only create a temporary file if we are actually going to do something
in the script. Eliminates a bug where we create a temp file, but don't
delete it since the rm(1) is only done if the check is enabled.
PR: bin/40960
Submitted by: frf <frf@xocolatl.com>
MFC after: 3 days
-rwxr-xr-x | etc/periodic/security/100.chksetuid | 2 | ||||
-rwxr-xr-x | etc/periodic/security/200.chkmounts | 2 | ||||
-rwxr-xr-x | etc/periodic/security/500.ipfwdenied | 2 | ||||
-rwxr-xr-x | etc/periodic/security/550.ipfwlimit | 2 | ||||
-rwxr-xr-x | etc/periodic/security/600.ip6fwdenied | 2 | ||||
-rwxr-xr-x | etc/periodic/security/650.ip6fwlimit | 2 | ||||
-rwxr-xr-x | etc/periodic/security/700.kernelmsg | 2 |
7 files changed, 7 insertions, 7 deletions
diff --git a/etc/periodic/security/100.chksetuid b/etc/periodic/security/100.chksetuid index 2bc6c52..9f97919 100755 --- a/etc/periodic/security/100.chksetuid +++ b/etc/periodic/security/100.chksetuid @@ -35,12 +35,12 @@ then source_periodic_confs fi -TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` LOG="${daily_status_security_logdir}" rc=0 case "$daily_status_security_chksetuid_enable" in [Yy][Ee][Ss]) + TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` echo "" echo 'Checking setuid files and devices:' # XXX Note that there is the possibility of overrunning the args to ls diff --git a/etc/periodic/security/200.chkmounts b/etc/periodic/security/200.chkmounts index 5d3116b..dbd2907 100755 --- a/etc/periodic/security/200.chkmounts +++ b/etc/periodic/security/200.chkmounts @@ -38,13 +38,13 @@ then source_periodic_confs fi -TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` LOG="${daily_status_security_logdir}" ignore="${daily_status_security_chkmounts_ignore}" rc=0 case "$daily_status_security_chkmounts_enable" in [Yy][Ee][Ss]) + TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` case "$daily_status_security_noamd" in [Yy][Ee][Ss]) ignore="${ignore}|^amd:" diff --git a/etc/periodic/security/500.ipfwdenied b/etc/periodic/security/500.ipfwdenied index b18e1cf..d65d72b 100755 --- a/etc/periodic/security/500.ipfwdenied +++ b/etc/periodic/security/500.ipfwdenied @@ -39,12 +39,12 @@ then source_periodic_confs fi -TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` LOG="${daily_status_security_logdir}" rc=0 case "$daily_status_security_ipfwdenied_enable" in [Yy][Ee][Ss]) + TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` if ipfw -a l 2>/dev/null | egrep "deny|reset|unreach" > ${TMP}; then if [ ! -f ${LOG}/ipfw.today ]; then rc=1 diff --git a/etc/periodic/security/550.ipfwlimit b/etc/periodic/security/550.ipfwlimit index 3d54331..653dcf1 100755 --- a/etc/periodic/security/550.ipfwlimit +++ b/etc/periodic/security/550.ipfwlimit @@ -38,11 +38,11 @@ then source_periodic_confs fi -TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` rc=0 case "$daily_status_security_ipfwlimit_enable" in [Yy][Ee][Ss]) + TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` 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 " | perl -n -e \ diff --git a/etc/periodic/security/600.ip6fwdenied b/etc/periodic/security/600.ip6fwdenied index 5ab1759..8205876 100755 --- a/etc/periodic/security/600.ip6fwdenied +++ b/etc/periodic/security/600.ip6fwdenied @@ -38,12 +38,12 @@ then source_periodic_confs fi -TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` LOG="${daily_status_security_logdir}" rc=0 case "$daily_status_security_ip6fwdenied_enable" in [Yy][Ee][Ss]) + TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` if ip6fw -a l 2>/dev/null | egrep "deny|reset|unreach" > ${TMP}; then if [ ! -f ${LOG}/ip6fw.today ]; then rc=1 diff --git a/etc/periodic/security/650.ip6fwlimit b/etc/periodic/security/650.ip6fwlimit index 2a1af39..3a19c99 100755 --- a/etc/periodic/security/650.ip6fwlimit +++ b/etc/periodic/security/650.ip6fwlimit @@ -38,11 +38,11 @@ then source_periodic_confs fi -TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` rc=0 case "$daily_status_security_ip6fwlimit_enable" in [Yy][Ee][Ss]) + TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` 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 " | perl -n -e \ diff --git a/etc/periodic/security/700.kernelmsg b/etc/periodic/security/700.kernelmsg index c1af584..5ac15c2 100755 --- a/etc/periodic/security/700.kernelmsg +++ b/etc/periodic/security/700.kernelmsg @@ -38,12 +38,12 @@ then source_periodic_confs fi -TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` LOG="${daily_status_security_logdir}" rc=0 case "$daily_status_security_kernelmsg_enable" in [Yy][Ee][Ss]) + TMP=`mktemp ${TMPDIR:-/tmp}/security.XXXXXXXXXX` if dmesg 2>/dev/null > ${TMP}; then if [ ! -f ${LOG}/dmesg.today ]; then rc=1 |