Date: Thu, 27 Dec 2001 01:19:45 -0800 From: "Crist J . Clark" <cristjc@earthlink.net> To: Bill Fenner <fenner@research.att.com> 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> In-Reply-To: <200112211552.HAA25429@windsor.research.att.com>; from fenner@research.att.com on Fri, Dec 21, 2001 at 07:52:43AM -0800 References: <200112211552.HAA25429@windsor.research.att.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011227011945.E2090>