A couple of scripts create temporary files - but those names are easy
to guess and could lead to security problems. A better solution would
be to use mktemp.
I've got here a patch which does the following:
--- lib-src/rcs2log
+++ lib-src/rcs2log Thu Nov 11 17:41:36 1999
@@ -279,6 +279,15 @@
llogout=$TMPDIR/rcs2log$$l
rlogout=$TMPDIR/rcs2log$$r
+rm -f $llogout $rlogout
+if test -e $llogout -o -e $rlogout ; then
+ echo "$0: temporary files $llogout or/and $rlogout exists." 1>&2
+ exit 1
+fi
+if test -n "`type -p mktemp`" ; then
+ llogout="`mktemp ${llogout}.XXXXXX`" || exit 1
+ rlogout="`mktemp ${rlogout}.XXXXXX`" || exit 1
+fi
trap exit 1 2 13 15
trap "rm -f $llogout $rlogout; exit 1" 0
What strikes me is that I don't know whether type -p is available in
/bin/sh.
Besides, does anybody have better ideas to rewrite this. There are a
number of other scripts which needs rewriting. I've some likes to do
this, I can forward the complete patch set I have.
Andreas
--
Andreas Jaeger
SuSE Labs aj(a)suse.de
private aj(a)arthur.rhein-neckar.de