--- LPRng-3.8.27/src/lprng_certs.orig	2004-12-20 00:29:21.000000000 +0100
+++ LPRng-3.8.27/src/lprng_certs.sh	2004-12-20 00:33:49.000000000 +0100
@@ -320,7 +320,9 @@
 # set default values
 
 
-CFG=/tmp/$$.sslcfg
+TMPDIR=`mktemp -d -t lprng.XXXXXX` || { echo "$0: Cannot create temporary directory!" >&2 ; exit 1; }
+trap "/bin/rm -rf ${TMPDIR}" 0 1 2 3 13 15
+CFG=$TMPDIR/sslcfg
 
 OPENSSL=/usr/bin/openssl
 CA_KEY=//etc/lprng/ssl.ca/ca.key
@@ -508,14 +510,14 @@
 	shift
 	if [ "$1" = "" ] ; then usage; fi;
 	if [ ! -f "$1" ] ; then useage; fi;
-	sed -n -e '/BEGIN.*PRIVATE KEY/,/END.*PRIVATE KEY/p' $1 >/tmp/$$.key
-	sed -e '/BEGIN.*PRIVATE KEY/,/END.*PRIVATE KEY/d' $1 >/tmp/$$.crt
-	STEP="" encrypt /tmp/$$.key
+	sed -n -e '/BEGIN.*PRIVATE KEY/,/END.*PRIVATE KEY/p' $1 >$TMPDIR/key
+	sed -e '/BEGIN.*PRIVATE KEY/,/END.*PRIVATE KEY/d' $1 >$TMPDIR/crt
+	STEP="" encrypt $TMPDIR/key 
 	status=$?
 	echo STATUS $status
 	if [ $status = 0 ] ; then
 		mv $1 $1.orig
-		cat /tmp/$$.crt /tmp/$$.key >$1
+		cat $TMPDIR/crt $TMPDIR/key >$1
 	fi
     ;;
 
@@ -845,5 +847,4 @@
     exit 1
     ;;
 esac
-rm -f ${CFG}
 exit $RET