File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 55
55
Build
56
56
-----
57
57
58
+ Tools/Demos
59
+ -----------
60
+
61
+ - Tools/faqwiz/move-faqwiz.sh: Fix unsecure use of temporary files.
62
+
58
63
What's New in Python 2.4.5?
59
64
=============================
60
65
Original file line number Diff line number Diff line change 9
9
# blackjesus:~> ./move-faqwiz.sh 2\.1 3\.2
10
10
# Moving FAQ question 02.001 to 03.002
11
11
12
- if [ x$2 == x ]; then
12
+ if [ x$2 = x ]; then
13
13
echo " Need 2 args: original_version final_version."
14
14
exit 2
15
15
fi
@@ -19,7 +19,7 @@ if [ ! -d data -o ! -d data/RCS ]; then
19
19
exit 2
20
20
fi
21
21
22
- function cut_n_pad() {
22
+ cut_n_pad () {
23
23
t=` echo $1 | cut -d. -f $2 `
24
24
export $3 =` echo $t | awk " { tmp = \\ $0 ; l = length(tmp); for (i = 0; i < $2 -l+1; i++) { tmp = " 0" .tmp } print tmp }" `
25
25
}
@@ -28,7 +28,13 @@ cut_n_pad $1 1 prefix1
28
28
cut_n_pad $1 2 suffix1
29
29
cut_n_pad $2 1 prefix2
30
30
cut_n_pad $2 2 suffix2
31
- tmpfile=tmp$RANDOM .tmp
31
+ if which tempfile > /dev/null; then
32
+ tmpfile=$( tempfile -d .)
33
+ elif [ -n " $RANDOM " ]; then
34
+ tmpfile=tmp$RANDOM .tmp
35
+ else
36
+ tmpfile=tmp$$ .tmp
37
+ fi
32
38
file1=faq$prefix1 .$suffix1 .htp
33
39
file2=faq$prefix2 .$suffix2 .htp
34
40
You can’t perform that action at this time.
0 commit comments