From admin@omnilan.de  Fri Aug 30 10:59:59 2013
Return-Path: <admin@omnilan.de>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 9F0E29D0
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 30 Aug 2013 10:59:59 +0000 (UTC)
	(envelope-from admin@omnilan.de)
Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 18C632AA7
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 30 Aug 2013 10:59:58 +0000 (UTC)
Received: from otho.lyra.inop.dcm1.omnilan.net (s0.omnilan.de [IPv6:2a00:e10:2800::243])
	by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id r7UAxinr040556
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 30 Aug 2013 12:59:49 +0200 (CEST)
	(envelope-from admin@altair.aquila.inop.dcm1.omnilan.net)
Received: from altair.aquila.inop.dcm1.omnilan.net (altair.aquila.inop.dcm1.omnilan.net [IPv6:2a00:e10:2804:a00::2:20])
	by otho.lyra.inop.dcm1.omnilan.net (8.14.5/8.14.5) with ESMTP id r7UAxnHY012296
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 30 Aug 2013 12:59:49 +0200 (CEST)
	(envelope-from admin@altair.aquila.inop.dcm1.omnilan.net)
Received: (from root@localhost)
	by altair.aquila.inop.dcm1.omnilan.net (8.14.7/8.14.7/Submit) id r7UAxmK3003988;
	Fri, 30 Aug 2013 12:59:48 +0200 (CEST)
	(envelope-from admin)
Message-Id: <201308301059.r7UAxmK3003988@altair.aquila.inop.dcm1.omnilan.net>
Date: Fri, 30 Aug 2013 12:59:48 +0200 (CEST)
From: freebsd@omnilan.de
Reply-To:
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: periodic inline security output missing with daily_show_success=NO
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         181681
>Category:       conf
>Synopsis:       periodic inline security output missing with daily_show_success=NO
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 30 11:10:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Wed Sep 18 01:10:00 UTC 2013
>Originator:     Harald Schmalzbauer
>Release:        FreeBSD 9.2-RC3+FP1 amd64
>Organization:
OmniLAN
>Environment:
System: FreeBSD altair.aquila.inop.dcm1.omnilan.net 9.2-RC3+FP1 FreeBSD 9.2-RC3+FP1 #5 r254954M: Tue Aug 27 15:22:39 CEST 2013 admin@preed.labshop.wdn.omnilan.net:/usr/local/share/deploy-tools/obj-amd64/VMWARE/usr/local/share/deploy-tools/RELENG_9_2/src/sys/VMWARE.altair amd64


	
>Description:
	If you don't want to get extra security letters from periodic,
you set daily_status_security_inline="YES" in your periodic.conf.
	If you also don't want to get results from successfull scripts,
you set daily_show_success="NO" in your periodic.conf.

Having this combination leads to no security letter at all, since 
450.status-security script starts security/* scripts and terminates
successfull at the end, regardless if security scripts return with >0.

>How-To-Repeat:
	Set the above described two option in periodic.conf and run 'periodic daily'
>Fix:

--- etc/periodic/daily/450.status-security	2013-08-30 12:35:17.000000000 +0200
+++ etc/periodic/daily/450.status-security	2013-08-30 12:38:21.000000000 +0200
@@ -18,7 +18,11 @@
 
 	case "$daily_status_security_inline" in
 	    [Yy][Ee][Ss])
-		daily_status_security_output="";;
+		daily_status_security_output=""
+		if [ "$daily_show_success" != "[Yy][Ee][Ss]" ]
+		then
+		    rc=1
+		fi;;
 	esac
 
 	export security_output="${daily_status_security_output}"

>Release-Note:
>Audit-Trail:

From: Jason Unovitch <jason.unovitch@gmail.com>
To: bug-followup@FreeBSD.org, freebsd@omnilan.de
Cc:  
Subject: Re: conf/181681: periodic inline security output missing with daily_show_success=NO
Date: Tue, 03 Sep 2013 20:21:55 -0400

 This is a multi-part message in MIME format.
 --------------040109030506080601020502
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: quoted-printable
 
 Harald,
 By any chance do you have a work around for the original broken version=20
 of 450.status.security in 9.1-RELEASE?  I submitted PR conf/178611 for a =
 
 patch in 9.1-RELEASE and have been using the patched version=20
 successfully with the same options ever since.  I have also tested=20
 9.2-RC3 and do not see the issue described. Additionally, 6 lines below=20
 the suggested patch the "rc=3D1" used get overridden anyway by an explici=
 t=20
 "rc=3D3;;" used to always show the inline case.  See the link below for=20
 the original PR from a few months ago for more details.
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=3D178611
 
 Respectfully,
 Jason Unovitch
 
 --------------040109030506080601020502
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: 8bit
 
 <html>
   <head>
 
     <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
   </head>
   <body text="#000000" bgcolor="#FFFFFF">
     Harald,<br>
     By any chance do you have a work around for the original broken
     version of 450.status.security in 9.1-RELEASE?&nbsp; I submitted PR
     conf/178611 for a patch in 9.1-RELEASE and have been using the
     patched version successfully with the same options ever since.&nbsp; I
     have also tested 9.2-RC3 and do not see the issue described.&nbsp;
     Additionally, 6 lines below the suggested patch the "rc=1" used get
     overridden anyway by an explicit "rc=3;;" used to always show the
     inline case.&nbsp; See the link below for the original PR from a few
     months ago for more details.<br>
     <br>
     <meta http-equiv="content-type" content="text/html;
       charset=ISO-8859-1">
     <a href="http://www.freebsd.org/cgi/query-pr.cgi?pr=178611">http://www.freebsd.org/cgi/query-pr.cgi?pr=178611</a><br>
     <br>
     Respectfully,<br>
     Jason Unovitch<br>
   </body>
 </html>
 
 --------------040109030506080601020502--

From: "freebsd@omnilan.de" <freebsd@omnilan.de>
To: Jason Unovitch <jason.unovitch@gmail.com>
Cc: bug-followup@FreeBSD.org
Subject: Re: conf/181681: periodic inline security output missing with daily_show_success=NO
Date: Mon, 16 Sep 2013 11:09:45 +0200

  Bezglich Jason Unovitch's Nachricht vom 04.09.2013 02:21 (localtime):
 > Harald,
 > By any chance do you have a work around for the original broken
 > version of 450.status.security in 9.1-RELEASE? I submitted PR conf/178611
 
 Hello Jason,
 
 sorry for that late reply, just want to let you know that I don't have
 anything further arround and unfortunately haven't looked into your
 conf/178611 yet.
 
 > for a patch in 9.1-RELEASE and have been using the patched version
 > successfully with the same options ever since. I have also tested
 > 9.2-RC3 and do not see the issue described. Additionally, 6 lines
 > below the suggested patch the "rc=1" used get overridden anyway by an 
 
 Couldn't you reproduce the problem from your PR (conf/178611) with
 9.2-RC3 or the probleme here (conf/181681)? The problem here is clearly
 by design and should be seen unconditionally.
 
 Thanks,
 
 -Harry
 

From: Jason Unovitch <jason.unovitch@gmail.com>
To: "freebsd@omnilan.de" <freebsd@omnilan.de>
Cc: bug-followup@FreeBSD.org
Subject: Re: conf/181681: periodic inline security output missing with daily_show_success=NO
Date: Tue, 17 Sep 2013 20:59:55 -0400

 Harry,
 Conf/178611 fixed the issue and that is what is in 9.2.  I just tested=20
 each use case on 9.2-RC4 and they work as reading the=20
 450.status-security and /usr/sbin/periodic would suggest.  With this=20
 /etc/periodic.conf:
 
 daily_show_success=3D"NO"
 daily_status_security_inline=3D"YES"
 
 The "daily run output" periodic email shows the inline output (abbreviate=
 d)
 =2E..
 Security check:
 
 Checking setuid files and devices:
 =2E..continued
 
 It looks fine.  Both these /etc/periodic.conf examples do the exact same =
 
 thing.  The 450.status-security script sets a blank string right at the=20
 top because of inline being set and the rc=3D3 case results in it always =
 
 being show.  Outputting to a file or other user gets ignored because of=20
 inline.
 daily_show_success=3D"NO"
 daily_status_security_inline=3D"YES"
 daily_status_security_output=3D/tmp/file
 
 daily_show_success=3D"NO"
 daily_status_security_inline=3D"YES"
 daily_status_security_output=3Droot
 
 
 Without the inline, this one results in the security output being=20
 written to a file.
 daily_show_success=3D"NO"
 daily_status_security_output=3D/tmp/file
 
 This one results in the security output going to my user account.
 daily_show_success=3D"NO"
 daily_status_security_output=3Djason
 
 -Jason Unovitch
 
 On 09/16/2013 05:09 AM, freebsd@omnilan.de wrote:
 >   Bez=FCglich Jason Unovitch's Nachricht vom 04.09.2013 02:21 (localtim=
 e):
 >> Harald,
 >> By any chance do you have a work around for the original broken
 >> version of 450.status.security in 9.1-RELEASE? I submitted PR conf/178=
 611
 > Hello Jason,
 >
 > sorry for that late reply, just want to let you know that I don't have
 > anything further arround and unfortunately haven't looked into your
 > conf/178611 yet.
 >
 >> for a patch in 9.1-RELEASE and have been using the patched version
 >> successfully with the same options ever since. I have also tested
 >> 9.2-RC3 and do not see the issue described. Additionally, 6 lines
 >> below the suggested patch the "rc=3D1" used get overridden anyway by a=
 n
 > Couldn't you reproduce the problem from your PR (conf/178611) with
 > 9.2-RC3 or the probleme here (conf/181681)? The problem here is clearly=
 
 > =84by design=93 and should be seen unconditionally.
 >
 > Thanks,
 >
 > -Harry
 >
 
 
>Unformatted:
