Skip to content

Commit 02571d4

Browse files
committed
Back-patch make_oidjoins_check security improvement.
1 parent 6b3d751 commit 02571d4

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

contrib/findoidjoins/make_oidjoins_check

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

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

1520
# Read input
16-
cat "$@" >/tmp/$$
21+
cat "$@" >$INPUTFILE
1722

1823
# Look for fields with multiple references.
19-
cat /tmp/$$ | cut -d' ' -f2 | sort | uniq -d >/tmp/$$a
20-
if [ -s /tmp/$$a ] ; then
24+
cat $INPUTFILE | cut -d' ' -f2 | sort | uniq -d >$DUPSFILE
25+
if [ -s $DUPSFILE ] ; then
2126
echo "Ignoring these fields that link to multiple tables:" 1>&2
22-
cat /tmp/$$a 1>&2
27+
cat $DUPSFILE 1>&2
2328
fi
2429

2530
# Get the non-multiply-referenced fields.
26-
cat /tmp/$$ | while read LINE
31+
cat $INPUTFILE | while read LINE
2732
do
2833
set -- $LINE
29-
grep "$2" /tmp/$$a >/dev/null 2>&1 || echo $LINE
30-
done >/tmp/$$b
34+
grep "^$2\$" $DUPSFILE >/dev/null 2>&1 || echo $LINE
35+
done >$NONDUPSFILE
3136

3237
# Generate the output.
33-
cat /tmp/$$b |
38+
cat $NONDUPSFILE |
3439
$AWK -F'[ \.]' '\
3540
BEGIN \
3641
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy