Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jan 2001 20:47:07 -0500
From:      Chris Faulhaber <jedgar@fxp.org>
To:        Mike Heffner <mheffner@vt.edu>
Cc:        FreeBSD-audit <FreeBSD-audit@freebsd.org>
Subject:   Re: manctl(8) tempfile fix
Message-ID:  <20010119204707.A53692@earth.causticlabs.com>
In-Reply-To: <XFMail.20001201175211.mheffner@vt.edu>; from mheffner@vt.edu on Fri, Dec 01, 2000 at 05:52:11PM -0500
References:  <20001201170620.A20094@earth.causticlabs.com> <XFMail.20001201175211.mheffner@vt.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010119204707.A53692>