From 2b62a972f5fd2f850f4648cc398a22e716714bc7 Mon Sep 17 00:00:00 2001 From: Jaromil Date: Thu, 28 Apr 2011 20:43:21 +0200 Subject: [PATCH] some fixes to tomb-open it would be ideal to make tomb-open never use 'sudo' but create internal tasks in tomb (like mktemp), this way if we enable users to create tombs on a system then just the full path to binary tomb is necessary in sudoers.... --- src/tomb-open | 52 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/src/tomb-open b/src/tomb-open index 24ed27c..c2a3ab1 100755 --- a/src/tomb-open +++ b/src/tomb-open @@ -131,7 +131,7 @@ ask_usbkey() { fi done - mtmp=$(/bin/mktemp -d --tmpdir tomb.XXXXXXXXXXXX) + mtmp=`$TOMBEXEC mktemp tomb` sudo mount /dev/$usbpart $mtmp if [ $? = 0 ]; then usbmount=$mtmp @@ -265,9 +265,11 @@ Create a new Tomb other people possessing it will discover your secrets, unless they have your USB key and your password. - If you choose to proceed now, we'll guide you through the creation + If you choose to proceed now, we'll guide you through the creation of a new Tomb. + If you will, I'll be your Crypto Undertaker. + Do you want to proceed, Master? (y/n) EOF echo -n "> " @@ -295,13 +297,18 @@ echo cat < " read -q @@ -310,9 +317,8 @@ if [ $? != 0 ]; then exit 1 fi cat < " @@ -338,18 +346,18 @@ if [ $? = 0 ]; then if [ ${usbkey_mount} ]; then sudo mkdir -m 0700 -p ${usbkey_mount}/.tomb - sudo cp -v ${tombname}.key ${usbkey_mount}/.tomb/ + sudo cp -v ${tombfile}.key ${usbkey_mount}/.tomb/ sudo chmod -R go-rwx ${usbkey_mount}/.tomb echo "${tombname}.key succesfully saved on your USB" echo "now we'll proceed opening your brand new tomb" - "${TOMBEXEC}" -k ${tombname}.tomb.key open ${tombfile} + "${TOMBEXEC}" -k ${tombfile}.key open ${tombfile} if [ $? = 0 ]; then launch_status ${tombname} fi - rm -f ${tombname}.tomb.key + rm -f ${tombfile}.key sudo umount ${usbkey_mount} rmdir ${usbkey_mount} @@ -361,9 +369,11 @@ fi cat <