From root@cakebox.homeunix.net  Thu Aug 30 09:43:08 2012
Return-Path: <root@cakebox.homeunix.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 80B4F106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 30 Aug 2012 09:43:08 +0000 (UTC)
	(envelope-from root@cakebox.homeunix.net)
Received: from mo6-p05-ob.rzone.de (mo6-p05-ob.rzone.de [IPv6:2a01:238:20a:202:5305::1])
	by mx1.freebsd.org (Postfix) with ESMTP id 11E1F8FC12
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 30 Aug 2012 09:43:07 +0000 (UTC)
Received: from cakebox.homeunix.net
	(164-010-186-093.dialin.vsenet.de [93.186.10.164])
	by smtp.strato.de (josoe mo37) (RZmta 30.12 DYNA|AUTH)
	with (DHE-RSA-AES256-SHA encrypted) ESMTPA id 406b87o7U99tUF ;
	Thu, 30 Aug 2012 11:43:04 +0200 (CEST)
Received: from cakebox.homeunix.net (localhost [127.0.0.1])
	by cakebox.homeunix.net (Postfix) with ESMTP id A0DE36791E;
	Thu, 30 Aug 2012 11:42:15 +0200 (CEST)
Received: by cakebox.homeunix.net (Postfix, from userid 0)
	id 7481167908; Thu, 30 Aug 2012 11:42:12 +0200 (CEST)
Message-Id: <20120830094212.7481167908@cakebox.homeunix.net>
Date: Thu, 30 Aug 2012 11:42:12 +0200 (CEST)
From: freebsd@nagilum.org
To: FreeBSD-gnats-submit@freebsd.org
Cc: kensmith@FreeBSD.org
Subject: make 460.chkportsum also report missing files
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         171180
>Category:       conf
>Synopsis:       [patch] make 460.chkportsum also report missing files
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ak
>State:          patched
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 30 09:50:00 UTC 2012
>Closed-Date:    
>Last-Modified:  Sat May 11 08:29:16 UTC 2013
>Originator:     freebsd@nagilum.org
>Release:        FreeBSD 10.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD cakebox.tis 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Wed Aug 29 13:01:13 CEST 2012 root@cakebox.tis:/usr/obj/export/src/sys/net5501 i386


>Description:
	The security daily script /etc/periodic/security/460.chkportsum
	fails to notify if a file from a port is missing.

>How-To-Repeat:
	1) add 'daily_status_security_chkportsum_enable="YES"' to 
	   your /etc/periodic.conf
	2) delete/rename a file that was installed via a port
	3) run "/etc/periodic/security/460.chkportsum" or wait 
	   for the daily security run output e-mail

>Fix:

	Apply attached patch.

--- 460.chkportsum.patch begins here ---
--- /etc/periodic/security/460.chkportsum.old	2012-07-15 01:36:21.000000000 +0200
+++ /etc/periodic/security/460.chkportsum	2012-08-30 11:33:27.000000000 +0200
@@ -43,7 +43,7 @@
 case "${daily_status_security_chkportsum_enable}" in
 	[Yy][Ee][Ss])
 	set -f
-	pkg_info -ga 2>/dev/null | \
+	stdbuf -o L pkg_info -ga 2>&1 | \
 	while IFS= read -r line; do
 		set -- $line
 		case $1 in
@@ -55,7 +55,7 @@
 			;;
 			Mismatched|'') ;;
 			*) [ -n "${name}" ] &&
-				echo "${name}: ${line%% fails the original MD5 checksum}"
+				echo "${name}: ${line%% fails the original MD5 checksum}"|sed -e 's/pkg_info: //' -e "s/doesn't\ exist/is\ missing/"
 			;;
 		esac
 	done
--- 460.chkportsum.patch ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ak 
Responsible-Changed-By: ak 
Responsible-Changed-When: Thu Aug 30 10:10:19 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=171180 

From: Alex Kozlov <spam@rm-rf.kiev.ua>
To: bug-followup@FreeBSD.org, freebsd@nagilum.org
Cc:  
Subject: Re: conf/171180: [patch] make 460.chkportsum also report missing
 files
Date: Wed, 8 May 2013 09:59:07 +0300

 Hi
 
 I apologize for the delay.
 Can you please update ports-mgmt/pkg to 1.0.12 and try new
 periodic script (460.pkg-checksum), included in the release?
 It should resolve reported issues.
 
 
 -- 
 Alex
State-Changed-From-To: open->feedback 
State-Changed-By: ak 
State-Changed-When: Wed May 8 07:04:23 UTC 2013 
State-Changed-Why:  
Ask for submitter approval. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=171180 
State-Changed-From-To: feedback->patched 
State-Changed-By: ak 
State-Changed-When: Sat May 11 08:28:25 UTC 2013 
State-Changed-Why:  
Fixed in pkgng, still an issue in pkgtools. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=171180 
>Unformatted:
