From owner-freebsd-bugs Sat Jan 4 10: 0:15 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9FF9737B401 for ; Sat, 4 Jan 2003 10:00:12 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 91C9943ED1 for ; Sat, 4 Jan 2003 10:00:11 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h04I0BNS010175 for ; Sat, 4 Jan 2003 10:00:11 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h04I0BHp010174; Sat, 4 Jan 2003 10:00:11 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ED91837B401 for ; Sat, 4 Jan 2003 09:50:55 -0800 (PST) Received: from mailout02.sul.t-online.com (mailout02.sul.t-online.com [194.25.134.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA2C943EC5 for ; Sat, 4 Jan 2003 09:50:54 -0800 (PST) (envelope-from se@FreeBSD.org) Received: from fwd08.sul.t-online.de by mailout02.sul.t-online.com with smtp id 18UsRh-0007gl-0A; Sat, 04 Jan 2003 18:50:53 +0100 Received: from Gatekeeper.FreeBSD.org (520047440004-0001@[80.132.254.189]) by fmrl08.sul.t-online.com with esmtp id 18UsRc-0YarTcC; Sat, 4 Jan 2003 18:50:48 +0100 Received: from StefanEsser.FreeBSD.org (StefanEsser [10.0.0.1]) by Gatekeeper.FreeBSD.org (Postfix) with ESMTP id D07475F1C for ; Sat, 4 Jan 2003 18:50:47 +0100 (CET) Received: by StefanEsser.FreeBSD.org (Postfix, from userid 200) id A296C14B3; Sat, 4 Jan 2003 18:50:47 +0100 (CET) Message-Id: <20030104175047.A296C14B3@StefanEsser.FreeBSD.org> Date: Sat, 4 Jan 2003 18:50:47 +0100 (CET) From: Stefan Esser Reply-To: Stefan Esser To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: misc/46759: [Patch] periodic scripts ignore .bz2 files Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 46759 >Category: misc >Synopsis: [Patch] periodic scripts ignore .bz2 files >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jan 04 10:00:11 PST 2003 >Closed-Date: >Last-Modified: >Originator: Stefan Esser >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD StefanEsser.FreeBSD.org 5.0-CURRENT FreeBSD 5.0-CURRENT #9: Sat Jan 4 09:52:47 CET 2003 se@StefanEsser.FreeBSD.org:/usr/src/sys/i386/compile/ISDN686 i386 >Description: When newsyslog.conf was modified to compress rotated log files with bzip2 instead of gzip some 3 months ago, most of the periodic scripts that process those log files were not tought how to decompress those archived files. This affects the following scripts: etc/periodic/daily/470.status-named etc/periodic/security/800.loginfail etc/periodic/security/900.tcpwrap >How-To-Repeat: Just check the scripts or their output for bzip2ed files ... >Fix: Just apply the following patch, which adds bzip2 support without dropping gzip support ... Index: etc/periodic/daily/470.status-named =================================================================== RCS file: /usr/cvs/src/etc/periodic/daily/470.status-named,v retrieving revision 1.4 diff -u -r1.4 470.status-named --- etc/periodic/daily/470.status-named 7 Dec 2002 23:37:44 -0000 1.4 +++ etc/periodic/daily/470.status-named 4 Jan 2003 17:33:00 -0000 @@ -14,7 +14,13 @@ catmsgs() { find /var/log -name 'messages.*' -mtime -2 | sort -t. -r -n -k 2,2 | - xargs zcat -f + while read f + do + case $f in + *.gz) zcat -f $f;; + *.bz2) bzcat -f $f;; + esac + done [ -f /var/log/messages ] && cat /var/log/messages } Index: etc/periodic/security/800.loginfail =================================================================== RCS file: /usr/cvs/src/etc/periodic/security/800.loginfail,v retrieving revision 1.4 diff -u -r1.4 800.loginfail --- etc/periodic/security/800.loginfail 24 Sep 2002 18:53:46 -0000 1.4 +++ etc/periodic/security/800.loginfail 4 Jan 2003 17:33:15 -0000 @@ -45,7 +45,13 @@ catmsgs() { find ${LOG} -name 'auth.log.*' -mtime -2 | sort -t. -r -n -k 2,2 | - xargs zcat -f + while read f + do + case $f in + *.gz) zcat -f $f;; + *.bz2) bzcat -f $f;; + esac + done [ -f ${LOG}/auth.log ] && cat $LOG/auth.log } Index: etc/periodic/security/900.tcpwrap =================================================================== RCS file: /usr/cvs/src/etc/periodic/security/900.tcpwrap,v retrieving revision 1.2 diff -u -r1.2 900.tcpwrap --- etc/periodic/security/900.tcpwrap 24 Sep 2002 18:53:46 -0000 1.2 +++ etc/periodic/security/900.tcpwrap 4 Jan 2003 17:33:38 -0000 @@ -45,7 +45,13 @@ catmsgs() { find ${LOG} -name 'messages.*' -mtime -2 | sort -t. -r -n -k 2,2 | - xargs zcat -f + while read f + do + case $f in + *.gz) zcat -f $f;; + *.bz2) bzcat -f $f;; + esac + done [ -f ${LOG}/messages ] && cat $LOG/messages } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message