| 1 |
--- scripts/sch2eaglepos.sh 2008-05-16 06:20:10.000000000 +0200
|
| 2 |
+++ scripts/sch2eaglepos.sh_cht 2008-11-18 21:49:04.000000000 +0100
|
| 3 |
@@ -2,6 +2,12 @@
|
| 4 |
# By Braddock Gaskill (braddock@braddock.com), August 2004. This
|
| 5 |
# software is hereby declared to be in the public domain by Braddock
|
| 6 |
# Gaskill, the author.
|
| 7 |
+
|
| 8 |
+# Updated by Chitlesh GOORAH - reason : Security bug on temporary file (18Nov2008)
|
| 9 |
+# The issue is that the value of TMP is predictable
|
| 10 |
+# and a local evildoer could create a symlink causing some data to be overwritten.
|
| 11 |
+#
|
| 12 |
+
|
| 13 |
FNAME="$1"
|
| 14 |
if [ -z "$FNAME" ]; then
|
| 15 |
echo "$0 <inputfile.sch>"
|
| 16 |
@@ -20,8 +26,8 @@
|
| 17 |
XSCALE=9000
|
| 18 |
YSCALE=9000
|
| 19 |
|
| 20 |
-TMP=/tmp/$$
|
| 21 |
-grep -B1 refdes= "$FNAME" |sed 's/=/ /' | cut -d" " -f2,3 |grep -v '^--' >/tmp/$$
|
| 22 |
+TMP=`mktemp`
|
| 23 |
+grep -B1 refdes= "$FNAME" |sed 's/=/ /' | cut -d" " -f2,3 |grep -v '^--' > $TMP
|
| 24 |
|
| 25 |
3<$TMP
|
| 26 |
while read -u 3; do
|