From owner-freebsd-audit Fri Jan 19 17:47:41 2001 Delivered-To: freebsd-audit@freebsd.org Received: from peitho.fxp.org (peitho.fxp.org [209.26.95.40]) by hub.freebsd.org (Postfix) with ESMTP id 6E3B837B400 for ; Fri, 19 Jan 2001 17:47:23 -0800 (PST) Received: from earth.causticlabs.com (oca-pm3-6-88.hitter.net [207.192.77.88]) by peitho.fxp.org (Postfix) with ESMTP id 9B3BE1360C; Fri, 19 Jan 2001 20:47:14 -0500 (EST) Received: by earth.causticlabs.com (Postfix, from userid 1000) id DE6881F82; Fri, 19 Jan 2001 20:47:07 -0500 (EST) Date: Fri, 19 Jan 2001 20:47:07 -0500 From: Chris Faulhaber To: Mike Heffner Cc: FreeBSD-audit Subject: Re: manctl(8) tempfile fix Message-ID: <20010119204707.A53692@earth.causticlabs.com> Mail-Followup-To: Chris Faulhaber , Mike Heffner , FreeBSD-audit References: <20001201170620.A20094@earth.causticlabs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from mheffner@vt.edu on Fri, Dec 01, 2000 at 05:52:11PM -0500 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Anyone object to me committing this? On Fri, Dec 01, 2000 at 05:52:11PM -0500, Mike Heffner wrote: > > Alright, I was considering this, but I figured I would leave it how it was, > anyways here's a new patch: > > > --- manctl.sh.orig Fri Dec 1 01:24:35 2000 > +++ manctl.sh Fri Dec 1 17:48:47 2000 > @@ -94,12 +94,13 @@ > else > if [ $2 != "symbolic" ] ; then > echo gunzipping page $pname 1>&2 > - gunzip -c $pname > /tmp/manager.$$ > + temp=`mktemp -t manager` || exit 1 > + gunzip -c $pname > $temp > chmod u+w $pname > - cp /tmp/manager.$$ $pname > + cp $temp $pname > chmod 444 $pname > mv $pname $fname.$sect > - rm /tmp/manager.$$ > + rm -f $temp > else > # skip symlinks - this can be > # a program like expn, which is > @@ -180,11 +181,13 @@ > ln ../$2 $fname > else > echo inlining page $fname 1>&2 > + temp=`mktemp -t manager` || exit 1 > cat $fname | \ > - (cd .. ; soelim ) > /tmp/manager.$$ > + (cd .. ; soelim ) > $temp > chmod u+w $fname > - cp /tmp/manager.$$ $fname > + cp $temp $fname > chmod 444 $fname > + rm -f $temp > fi > } > > @@ -279,13 +282,14 @@ > else > if [ $2 != "symbolic" ] ; then > echo gzipping page $pname 1>&2 > + temp=`mktemp -t manager` || exit 1 > cat $pname | \ > - (cd .. ; soelim )| gzip -c -- > /tmp/manager.$$ > + (cd .. ; soelim )| gzip -c -- > $temp > chmod u+w $pname > - cp /tmp/manager.$$ $pname > + cp $temp $pname > chmod 444 $pname > mv $pname $pname.gz > - rm /tmp/manager.$$ > + rm -f $temp > else > # skip symlink - this can be > # a program like expn, which is > -- Chris D. Faulhaber - jedgar@fxp.org - jedgar@FreeBSD.org -------------------------------------------------------- FreeBSD: The Power To Serve - http://www.FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message