From owner-svn-src-stable-11@freebsd.org Fri Apr 28 14:43:16 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3D02D538F9; Fri, 28 Apr 2017 14:43:15 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE4EFB29; Fri, 28 Apr 2017 14:43:15 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3SEhEJx099639; Fri, 28 Apr 2017 14:43:14 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3SEhEWk099636; Fri, 28 Apr 2017 14:43:14 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201704281443.v3SEhEWk099636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 28 Apr 2017 14:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317554 - in stable/11/etc/periodic: daily monthly weekly X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Apr 2017 14:43:16 -0000 Author: asomers Date: Fri Apr 28 14:43:14 2017 New Revision: 317554 URL: https://svnweb.freebsd.org/changeset/base/317554 Log: MFC r316548: Quiet 450.status-security when *_inline="YES" Previously, 450.status-security would always set rc=3 in inline mode, because it doesn't know whether "periodic security" is going to find anything interesting. But this annoyingly results in daily reports that simply say "Security check: \n\n-- End of daily output --". This change fixes that by testing whether "periodic security" printed anything, and setting 450.status-security's exit status to 3 if it did. An alternative would be to change the exit status of periodic(8) to be the worst of its scripts' exit statuses, but that would be a more intrusive change. Reviewed by: brian Differential Revision: https://reviews.freebsd.org/D10267 Modified: stable/11/etc/periodic/daily/450.status-security stable/11/etc/periodic/monthly/450.status-security stable/11/etc/periodic/weekly/450.status-security Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/periodic/daily/450.status-security ============================================================================== --- stable/11/etc/periodic/daily/450.status-security Fri Apr 28 13:15:41 2017 (r317553) +++ stable/11/etc/periodic/daily/450.status-security Fri Apr 28 14:43:14 2017 (r317554) @@ -22,19 +22,25 @@ case "$daily_status_security_enable" in esac export security_output="${daily_status_security_output}" + rc=0 case "${daily_status_security_output}" in "") - rc=3;; + if tempfile=`mktemp ${TMPDIR:-/tmp}/450.status-security.XXXXXX` + then + periodic security > $tempfile || rc=3 + if [ -s "$tempfile" ]; then + cat "$tempfile" + rc=3 + fi + rm -f "$tempfile" + fi;; /*) echo " (output logged separately)" - rc=0;; + periodic security || rc=3;; *) echo " (output mailed separately)" - rc=0;; - esac - - periodic security || rc=3;; - + periodic security || rc=3;; + esac;; *) rc=0;; esac Modified: stable/11/etc/periodic/monthly/450.status-security ============================================================================== --- stable/11/etc/periodic/monthly/450.status-security Fri Apr 28 13:15:41 2017 (r317553) +++ stable/11/etc/periodic/monthly/450.status-security Fri Apr 28 14:43:14 2017 (r317554) @@ -22,19 +22,25 @@ case "$monthly_status_security_enable" i esac export security_output="${monthly_status_security_output}" + rc=0 case "${monthly_status_security_output}" in "") - rc=3;; + if tempfile=`mktemp ${TMPDIR:-/tmp}/450.status-security.XXXXXX` + then + periodic security > $tempfile || rc=3 + if [ -s "$tempfile" ]; then + cat "$tempfile" + rc=3 + fi + rm -f "$tempfile" + fi;; /*) echo " (output logged separately)" - rc=0;; + periodic security || rc=3;; *) echo " (output mailed separately)" - rc=0;; - esac - - periodic security || rc=3;; - + periodic security || rc=3;; + esac;; *) rc=0;; esac Modified: stable/11/etc/periodic/weekly/450.status-security ============================================================================== --- stable/11/etc/periodic/weekly/450.status-security Fri Apr 28 13:15:41 2017 (r317553) +++ stable/11/etc/periodic/weekly/450.status-security Fri Apr 28 14:43:14 2017 (r317554) @@ -22,19 +22,25 @@ case "$weekly_status_security_enable" in esac export security_output="${weekly_status_security_output}" + rc=0 case "${weekly_status_security_output}" in "") - rc=3;; + if tempfile=`mktemp ${TMPDIR:-/tmp}/450.status-security.XXXXXX` + then + periodic security > $tempfile || rc=3 + if [ -s "$tempfile" ]; then + cat "$tempfile" + rc=3 + fi + rm -f "$tempfile" + fi;; /*) echo " (output logged separately)" - rc=0;; + periodic security || rc=3;; *) echo " (output mailed separately)" - rc=0;; - esac - - periodic security || rc=3;; - + periodic security || rc=3;; + esac;; *) rc=0;; esac