Use secure temporary filenames during build.

Audited by:	markm, cracauer
This commit is contained in:
Kris Kennaway 2000-11-22 11:05:51 +00:00
parent 5616d3cc64
commit c8b46b3ee3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=69029
2 changed files with 9 additions and 8 deletions

View File

@ -37,7 +37,7 @@
# @(#)mkbuiltins 8.2 (Berkeley) 5/4/95
# $FreeBSD$
temp=/tmp/ka$$
temp=`/usr/bin/mktemp -t ka`
havejobs=0
if grep '^#define JOBS[ ]*1' shell.h > /dev/null
then havejobs=1

View File

@ -41,7 +41,8 @@
# token marks the end of a list. The third column is the name to print in
# error messages.
cat > /tmp/ka$$ <<\!
temp=`/usr/bin/mktemp -t ka`
cat > $temp <<\!
TEOF 1 end of file
TNL 0 newline
TSEMI 0 ";"
@ -71,25 +72,25 @@ TCASE 0 "case"
TESAC 1 "esac"
TNOT 0 "!"
!
nl=`wc -l /tmp/ka$$`
nl=`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[] = {'
awk '{print "\t" $2 ","}' /tmp/ka$$
awk '{print "\t" $2 ","}' $temp
echo '};
char *const tokname[] = {'
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 parsekwd[] = {"}
/TIF/,/neverfound/{print " \"" $3 "\","}'
echo ' 0
};'
rm /tmp/ka$$
rm $temp