diff --git a/src/tomb b/src/tomb index 27daa80..cbc52d3 100755 --- a/src/tomb +++ b/src/tomb @@ -575,6 +575,7 @@ mount_tomb() { if [ $? != 0 ]; then # is it a LUKS encrypted nest? see cryptsetup(1) error "$tombfile is not a valid Luks encrypted storage file" + rmdir $tombmount 2>/dev/null return 1 fi @@ -611,12 +612,14 @@ mount_tomb() { if [ -r ${usbkey_mount}/.tomb/${tombkey} ]; then umount ${usbkey_mount} + rmdir ${usbkey_mount} unset ${usbkey_mount} fi if ! [ -r /dev/mapper/${mapper} ]; then error "failure mounting the encrypted file" losetup -d ${nstloop} + rmdir ${tombmount} 2>/dev/null return 1 fi