summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-08-31 09:57:10 +0000
committerUlrich Drepper <drepper@redhat.com>1998-08-31 09:57:10 +0000
commitd11a03e78581d98c060d8a0c3be936bc2e333dbf (patch)
treedfc1b8c698845d63e540962e5ade6e990285002f
parentcafbab222bee0397ffd73f51d76f29c5fe0b9f0b (diff)
downloadglibc-d11a03e78581d98c060d8a0c3be936bc2e333dbf.tar.gz
Use mktemp to generate temporary files.
-rw-r--r--glibcbug.in25
1 files changed, 18 insertions, 7 deletions
diff --git a/glibcbug.in b/glibcbug.in
index 8183d195df..f73486d2d3 100644
--- a/glibcbug.in
+++ b/glibcbug.in
@@ -19,7 +19,18 @@ STDIO="@stdio@"
PATH=/bin:/usr/bin:/usr/local/bin:$PATH
export PATH
-TEMP=/tmp/glibcbug.$$
+TEMP=`mktemp -q /tmp/glibcbugXXXXXX 2>/dev/null`
+if test $? -ne 0; then
+ TEMP=/tmp/glibcbug.$$
+ echo > $TEMP
+ chmod 600 $TEMP
+fi
+TEMPx=`mktemp -q /tmp/glibcbugXXXXXX 2>/dev/null`
+if test $? -ne 0; then
+ TEMPx=/tmp/glibcbug.$$.x
+ echo > $TEMPx
+ chmod 600 $TEMPx
+fi
BUGADDR=${1-$BUGGLIBC}
ENVIRONMENT=`uname -a`
@@ -28,8 +39,8 @@ ENVIRONMENT=`uname -a`
: ${USER=${LOGNAME-`whoami`}}
-trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15
-trap 'rm -f $TEMP $TEMP.x' 0
+trap 'rm -f $TEMP $TEMPx; exit 1' 1 2 3 13 15
+trap 'rm -f $TEMP $TEMPx' 0
# How to read the passwd database.
@@ -147,11 +158,11 @@ ${ORGANIZATION- $ORGANIZATION_C}
EOF
chmod u+w $TEMP
-cp $TEMP $TEMP.x
+cp $TEMP $TEMPx
eval $EDIT $TEMP
-if cmp -s $TEMP $TEMP.x; then
+if cmp -s $TEMP $TEMPx; then
echo "File not changed, no bug report submitted."
exit 1
fi
@@ -244,9 +255,9 @@ sed -e "
/^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;;
/^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;;
/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;;
-" $TEMP > $TEMP.x
+" $TEMP > $TEMPx
-if $MAIL_AGENT < $TEMP.x; then
+if $MAIL_AGENT < $TEMPx; then
echo "$COMMAND: problem report sent"
xs=0; exit
else