mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
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:
parent
aa9ea72bfb
commit
18a5139d7a
1 changed files with 6 additions and 5 deletions
|
@ -142,7 +142,7 @@ ConvertRoutine()
|
|||
;;
|
||||
esac
|
||||
|
||||
cat > /tmp/awk$$ <<EOF
|
||||
cat > $TMPFILE <<EOF
|
||||
#
|
||||
# The function name "PRTREC" is used by the parsing routines
|
||||
# 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.
|
||||
# IBM's awk only allows one "-f"
|
||||
#
|
||||
cat "$UDB_PARSE_LIB" >> /tmp/awk$$
|
||||
[ -z "$CUSTOM_PRINT" ] || cat "$CUSTOM_PRINT_LIB" >> /tmp/awk$$
|
||||
cat "$UDB_PARSE_LIB" >> $TMPFILE
|
||||
[ -z "$CUSTOM_PRINT" ] || cat "$CUSTOM_PRINT_LIB" >> $TMPFILE
|
||||
|
||||
$AWK -v mailTo="$Administrator" \
|
||||
-v action="$DoAction" \
|
||||
|
@ -176,7 +176,7 @@ EOF
|
|||
-v UseDefaultBlocks="$UseDefaultBlocks" \
|
||||
-v DeBugFile="$DEBUGFILE" \
|
||||
-v DeBug="$DEBUGLEVEL" \
|
||||
-f /tmp/awk$$ $*
|
||||
-f $TMPFILE $*
|
||||
|
||||
|
||||
#
|
||||
|
@ -185,7 +185,7 @@ EOF
|
|||
# -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 DEBUGFILE="/dev/tty"
|
||||
typeset DEBUGLEVEL=0
|
||||
typeset TMPFILE=`mktemp /tmp/awkXXXXXXXXXXXXXXXXXXXXX`
|
||||
|
||||
if [ $# -gt 2 ]; then
|
||||
while [ $# -gt 0 ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue