702687f
diff --git a/fax/faxspool.in b/fax/faxspool.in
702687f
index 2a2ee2c..2be42fc 100644
702687f
--- a/fax/faxspool.in
702687f
+++ b/fax/faxspool.in
702687f
@@ -708,10 +708,14 @@ do
cvsdist 1008ce2
 #
cvsdist 1008ce2
     if [ x$file = x- ]
cvsdist 1008ce2
     then
cvsdist 1008ce2
+	file=`mktemp /tmp/faxspool.XXXXXX`
cvsdist 1008ce2
+	if test -z $file
cvsdist 1008ce2
+	then
cvsdist 1008ce2
+	    $echo "ERROR: can't create work file, giving up" >&2 ; exit 6
cvsdist 1008ce2
+	fi
cvsdist 1008ce2
+	trap "rm $file" 0
cvsdist 1008ce2
 	$echo "spooling $file (stdin)..."
cvsdist 1008ce2
-	trap "rm /tmp/faxsp.$$" 0
cvsdist 1008ce2
-        cat - >/tmp/faxsp.$$
cvsdist 1008ce2
-	file=/tmp/faxsp.$$
cvsdist 1008ce2
+        cat - >$file
cvsdist 1008ce2
     else
cvsdist 1008ce2
 	$echo "spooling $file..."
cvsdist 1008ce2
     fi