aboutsummaryrefslogtreecommitdiff
path: root/lib/tools.in
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tools.in')
-rw-r--r--lib/tools.in19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/tools.in b/lib/tools.in
new file mode 100644
index 0000000..89f2ff7
--- /dev/null
+++ b/lib/tools.in
@@ -0,0 +1,19 @@
+#!@BASH@
+
+
+#
+# create a temporary file in a secure way.
+#
+function maketemp() {
+ if [ -x /bin/mktemp ]
+ then
+ local tempfile=`mktemp /tmp/$1.XXXXXXXX`
+ else
+ DATE=`date`
+ sectmp=`echo $DATE | /usr/bin/md5sum | cut -d- -f1`
+ local tempfile=/tmp/$1.$sectmp
+ fi
+ echo $tempfile
+}
+
+