mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-29 16:24:07 +00:00
safe_dir supports mktemp
if available, use it. otherwise, keep using our hack
This commit is contained in:
parent
0095a89d4d
commit
1594b2c825
7
src/tomb
7
src/tomb
@ -84,6 +84,11 @@ check_bin() {
|
|||||||
|
|
||||||
# safe dir creation function
|
# safe dir creation function
|
||||||
safe_dir() {
|
safe_dir() {
|
||||||
|
try mktemp
|
||||||
|
if [[ $? = 0 ]]; then
|
||||||
|
mktemp -d /dev/shm/$1.XXXX.$$
|
||||||
|
return
|
||||||
|
fi
|
||||||
dir="/dev/shm/$1.$RANDOM.$RANDOM.$$"
|
dir="/dev/shm/$1.$RANDOM.$RANDOM.$$"
|
||||||
(umask 077 && mkdir "$dir") || echo "-1"
|
(umask 077 && mkdir "$dir") || echo "-1"
|
||||||
echo "$dir"
|
echo "$dir"
|
||||||
@ -298,7 +303,7 @@ create_tomb() {
|
|||||||
act "Generating secret key..."
|
act "Generating secret key..."
|
||||||
act "this operation takes time, keep using this computer on other tasks,"
|
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 "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
|
touch ${keytmp}/tomb.tmp
|
||||||
chmod 0600 ${keytmp}/tomb.tmp
|
chmod 0600 ${keytmp}/tomb.tmp
|
||||||
if [[ $DD = "dcfldd" ]]; then
|
if [[ $DD = "dcfldd" ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user