mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-26 16:18:31 +00:00
Use secure temporary filenames during build.
Audited by: markm, cracauer
This commit is contained in:
parent
5616d3cc64
commit
c8b46b3ee3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=69029
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user