From 1594b2c8256aebf5a85b6f7c445ed68c7ab150f8 Mon Sep 17 00:00:00 2001 From: boyska Date: Thu, 28 Apr 2011 23:48:37 +0200 Subject: [PATCH] safe_dir supports mktemp if available, use it. otherwise, keep using our hack --- src/tomb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tomb b/src/tomb index 59e67b6..a388122 100755 --- a/src/tomb +++ b/src/tomb @@ -84,6 +84,11 @@ check_bin() { # safe dir creation function safe_dir() { + try mktemp + if [[ $? = 0 ]]; then + mktemp -d /dev/shm/$1.XXXX.$$ + return + fi dir="/dev/shm/$1.$RANDOM.$RANDOM.$$" (umask 077 && mkdir "$dir") || echo "-1" echo "$dir" @@ -298,7 +303,7 @@ create_tomb() { act "Generating secret key..." act "this operation takes time, keep using this computer on other tasks," act "once done you will be asked to choose a password for your tomb." - act "To make it faster you can move the mouse" + act "To make it faster you can move the mouse around" touch ${keytmp}/tomb.tmp chmod 0600 ${keytmp}/tomb.tmp if [[ $DD = "dcfldd" ]]; then