From owner-cvs-all Thu Dec 27 1:21:39 2001 Delivered-To: cvs-all@freebsd.org Received: from pintail.mail.pas.earthlink.net (pintail.mail.pas.earthlink.net [207.217.120.122]) by hub.freebsd.org (Postfix) with ESMTP id 31F0737B405; Thu, 27 Dec 2001 01:21:31 -0800 (PST) Received: from dialup-209.245.143.185.dial1.sanjose1.level3.net ([209.245.143.185] helo=blossom.cjclark.org) by pintail.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 16JWix-0007Kj-00; Thu, 27 Dec 2001 01:21:28 -0800 Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.3) id fBR9Jng04402; Thu, 27 Dec 2001 01:19:49 -0800 (PST) (envelope-from cjc) Date: Thu, 27 Dec 2001 01:19:45 -0800 From: "Crist J . Clark" To: Bill Fenner Cc: cvs-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/etc Makefile security src/etc/defaults periodic.conf src/etc/mtree BSD.root.dist src/etc/periodic Makefile src/etc/periodic/daily 450.status-security src/etc/periodic/security 100.chksetuid 200.chkmounts 300.chkuid0 ... Message-ID: <20011227011945.E2090@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <200112211552.HAA25429@windsor.research.att.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200112211552.HAA25429@windsor.research.att.com>; from fenner@research.att.com on Fri, Dec 21, 2001 at 07:52:43AM -0800 X-URL: http://people.freebsd.org/~cjc/ Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Dec 21, 2001 at 07:52:43AM -0800, Bill Fenner wrote: > > > ... /etc/security has been > > broken into periodic(8) scripts to make local customization easier and > > more maintainable. > > This is a great step, but my mail filter no longer filters the security > check email into the right mailbox. It uses the regexp > > /((daily|weekly|monthly) run|security check) output/ > > on the subject line. Now, I realize I can just add "|security" > in the first alternative, but now my 4.x boxes will still send me > "security check" outputs and my -current boxes will send "security run" > outputs, meaning that I maybe have to think a little more when > searching for them. (e.g. searching for "security check" won't > get me all of them.) > > Any thoughts on modifying /usr/sbin/periodic so it uses the > traditional security check output subject line? How about, Index: periodic.sh =================================================================== RCS file: /export/ncvs/src/usr.sbin/periodic/periodic.sh,v retrieving revision 1.19 diff -u -r1.19 periodic.sh --- periodic.sh 26 Nov 2000 03:37:34 -0000 1.19 +++ periodic.sh 27 Dec 2001 09:13:10 -0000 @@ -40,7 +40,12 @@ case "$output" in /*) pipe="cat >>$output";; "") pipe=cat;; - *) pipe="mail -s '$host ${arg##*/} run output' $output";; + *) eval subject=\$${arg##*/}_subject + if [ -z "$subject" ]; then + pipe="mail -s '$host ${arg##*/} run output' $output" + else + pipe="mail -s '$subject' $output" + fi;; esac success=YES info=YES badconfig=NO # Defaults when ${run}_* aren't YES/NO And then the user can just do something like, # echo 'security_subject="$HOST security check"' >> /etc/periodic.conf To get whatever subject he wishes. -- "It's always funny until someone gets hurt. Then it's hilarious." Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message