Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Nov 2000 04:54:44 -0800
From:      Kris Kennaway <kris@FreeBSD.ORG>
To:        Kris Kennaway <kennaway@citusc.usc.edu>
Cc:        audit@FreeBSD.ORG, cracauer@FreeBSD.ORG
Subject:   Re: sh compilation tempfile fixes
Message-ID:  <20001119045444.A93730@citusc17.usc.edu>
In-Reply-To: <20001119041833.A93062@citusc17.usc.edu>; from kennaway@citusc.usc.edu on Sun, Nov 19, 2000 at 04:18:33AM -0800
References:  <20001119041833.A93062@citusc17.usc.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

--3MwIy2ne0vdjdPXF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Here's a better patch:

Index: mkbuiltins
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /mnt/ncvs/src/bin/sh/mkbuiltins,v
retrieving revision 1.8
diff -u -r1.8 mkbuiltins
--- mkbuiltins	1999/08/27 23:15:18	1.8
+++ mkbuiltins	2000/11/19 12:52:17
@@ -37,7 +37,7 @@
 #	@(#)mkbuiltins	8.2 (Berkeley) 5/4/95
 # $FreeBSD: src/bin/sh/mkbuiltins,v 1.8 1999/08/27 23:15:18 peter Exp $
=20
-temp=3D/tmp/ka$$
+temp=3D`mktemp -t ka`
 havejobs=3D0
 if grep '^#define JOBS[	 ]*1' shell.h > /dev/null
 then	havejobs=3D1
Index: mktokens
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /mnt/ncvs/src/bin/sh/mktokens,v
retrieving revision 1.6
diff -u -r1.6 mktokens
--- mktokens	1999/08/27 23:15:19	1.6
+++ mktokens	2000/11/19 12:52:04
@@ -41,7 +41,8 @@
 # token marks the end of a list.  The third column is the name to print in
 # error messages.
=20
-cat > /tmp/ka$$ <<\!
+temp=3D`mktemp -t ka`
+cat > $temp <<\!
 TEOF	1	end of file
 TNL	0	newline
 TSEMI	0	";"
@@ -71,25 +72,25 @@
 TESAC	1	"esac"
 TNOT	0	"!"
 !
-nl=3D`wc -l /tmp/ka$$`
+nl=3D`wc -l $temp`
 exec > token.h
-awk '{print "#define " $1 " " NR-1}' /tmp/ka$$
+awk '{print "#define " $1 " " NR-1}' $temp
 echo '
 /* Array indicating which tokens mark the end of a list */
 const char tokendlist[] =3D {'
-awk '{print "\t" $2 ","}' /tmp/ka$$
+awk '{print "\t" $2 ","}' $temp
 echo '};
=20
 char *const tokname[] =3D {'
 sed -e 's/"/\\"/g' \
     -e 's/[^	 ]*[	 ][	 ]*[^	 ]*[	 ][	 ]*\(.*\)/	"\1",/' \
-    /tmp/ka$$
+    $temp
 echo '};
 '
-sed 's/"//g' /tmp/ka$$ | awk '
+sed 's/"//g' $temp | awk '
 /TIF/{print "#define KWDOFFSET " NR-1; print ""; print "char *const parsek=
wd[] =3D {"}
 /TIF/,/neverfound/{print "	\"" $3 "\","}'
 echo '	0
 };'
=20
-rm /tmp/ka$$
+rm $temp

--3MwIy2ne0vdjdPXF
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (FreeBSD)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjoXzZQACgkQWry0BWjoQKUT5gCgmAWxF9VYza80V6caKQLQ9YmB
jGEAoLgGo1xz2ouOvqi/WrPxMw9NHP7w
=GUfY
-----END PGP SIGNATURE-----

--3MwIy2ne0vdjdPXF--


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?20001119045444.A93730>