Do not use the PID as a way of generating a "random" filename.
This script did not even check for the file's existence prior to cat'ing random stuff into it. Ouch.
This commit is contained in:
committed by
Jon Trulson
parent
aa9ea72bfb
commit
18a5139d7a
@@ -142,7 +142,7 @@ ConvertRoutine()
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
cat > /tmp/awk$$ <<EOF
|
cat > $TMPFILE <<EOF
|
||||||
#
|
#
|
||||||
# The function name "PRTREC" is used by the parsing routines
|
# The function name "PRTREC" is used by the parsing routines
|
||||||
# to do the output. By providing a custom output function you
|
# to do the output. By providing a custom output function you
|
||||||
@@ -166,8 +166,8 @@ EOF
|
|||||||
# Create a single awk file for use with the "-f" parameter.
|
# Create a single awk file for use with the "-f" parameter.
|
||||||
# IBM's awk only allows one "-f"
|
# IBM's awk only allows one "-f"
|
||||||
#
|
#
|
||||||
cat "$UDB_PARSE_LIB" >> /tmp/awk$$
|
cat "$UDB_PARSE_LIB" >> $TMPFILE
|
||||||
[ -z "$CUSTOM_PRINT" ] || cat "$CUSTOM_PRINT_LIB" >> /tmp/awk$$
|
[ -z "$CUSTOM_PRINT" ] || cat "$CUSTOM_PRINT_LIB" >> $TMPFILE
|
||||||
|
|
||||||
$AWK -v mailTo="$Administrator" \
|
$AWK -v mailTo="$Administrator" \
|
||||||
-v action="$DoAction" \
|
-v action="$DoAction" \
|
||||||
@@ -176,7 +176,7 @@ EOF
|
|||||||
-v UseDefaultBlocks="$UseDefaultBlocks" \
|
-v UseDefaultBlocks="$UseDefaultBlocks" \
|
||||||
-v DeBugFile="$DEBUGFILE" \
|
-v DeBugFile="$DEBUGFILE" \
|
||||||
-v DeBug="$DEBUGLEVEL" \
|
-v DeBug="$DEBUGLEVEL" \
|
||||||
-f /tmp/awk$$ $*
|
-f $TMPFILE $*
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -185,7 +185,7 @@ EOF
|
|||||||
# -f "$UDB_PARSE_LIB" \
|
# -f "$UDB_PARSE_LIB" \
|
||||||
#
|
#
|
||||||
|
|
||||||
rm /tmp/awk$$
|
rm $TMPFILE
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -246,6 +246,7 @@ typeset UDB_PARSE_LIB="$DBTOOLSRC/udbParseLib.awk"
|
|||||||
typeset CUSTOM_PRINT_LIB=""
|
typeset CUSTOM_PRINT_LIB=""
|
||||||
typeset DEBUGFILE="/dev/tty"
|
typeset DEBUGFILE="/dev/tty"
|
||||||
typeset DEBUGLEVEL=0
|
typeset DEBUGLEVEL=0
|
||||||
|
typeset TMPFILE=`mktemp /tmp/awkXXXXXXXXXXXXXXXXXXXXX`
|
||||||
|
|
||||||
if [ $# -gt 2 ]; then
|
if [ $# -gt 2 ]; then
|
||||||
while [ $# -gt 0 ]
|
while [ $# -gt 0 ]
|
||||||
|
|||||||
Reference in New Issue
Block a user