diff options
author | kris <kris@FreeBSD.org> | 2000-11-22 11:05:51 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2000-11-22 11:05:51 +0000 |
commit | f99b720bd3ef9ce7f798710a7ba92f3f896d47d5 (patch) | |
tree | 558e3b27b59db00f5435ce8d8333dc6a4d59170a /bin/sh | |
parent | 6a7c444bc043548e4b056589b63dd83041e38310 (diff) | |
download | FreeBSD-src-f99b720bd3ef9ce7f798710a7ba92f3f896d47d5.zip FreeBSD-src-f99b720bd3ef9ce7f798710a7ba92f3f896d47d5.tar.gz |
Use secure temporary filenames during build.
Audited by: markm, cracauer
Diffstat (limited to 'bin/sh')
-rwxr-xr-x | bin/sh/mkbuiltins | 2 | ||||
-rw-r--r-- | bin/sh/mktokens | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/bin/sh/mkbuiltins b/bin/sh/mkbuiltins index 89f50d2..e53f2b3 100755 --- a/bin/sh/mkbuiltins +++ b/bin/sh/mkbuiltins @@ -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 diff --git a/bin/sh/mktokens b/bin/sh/mktokens index 172bb23..8632dc1 100644 --- a/bin/sh/mktokens +++ b/bin/sh/mktokens @@ -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 |