Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0f7a2a5

Browse files
committed
Create temporary files securely.
1 parenta809899 commit0f7a2a5

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

‎contrib/findoidjoins/make_oidjoins_check

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,23 @@
1010
# Caution: you may need to use GNU awk.
1111
AWK=${AWK:-awk}
1212

13-
INPUTFILE="tmp$$a"
14-
DUPSFILE="tmp$$b"
15-
NONDUPSFILE="tmp$$c"
16-
rm -f$INPUTFILE$DUPSFILE$NONDUPSFILE
13+
TMP="/tmp/$$"
14+
trap"rm -rf$TMP" 0 1 2 3 15
1715

18-
trap"rm -f$INPUTFILE$DUPSFILE$NONDUPSFILE" 0 1 2 3 15
16+
# Create a temporary directory with the proper permissions so no one can
17+
# intercept our temporary files and cause a security breach.
18+
OMASK="`umask`"
19+
umask 077
20+
if! mkdir$TMP
21+
thenecho"Can't create temporary directory$TMP."1>&2
22+
exit 1
23+
fi
24+
umask"$OMASK"
25+
unset OMASK
26+
27+
INPUTFILE="$TMP/a"
28+
DUPSFILE="$TMP/b"
29+
NONDUPSFILE="$TMP/c"
1930

2031
# Read input
2132
cat"$@">$INPUTFILE

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp