Skip to content

Commit

Permalink
Regression fix
Browse files Browse the repository at this point in the history
  • Loading branch information
partoneoftwo committed Aug 5, 2013
1 parent 956709a commit 232072e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 22 deletions.
15 changes: 7 additions & 8 deletions LUKSUS
Expand Up @@ -70,7 +70,6 @@ fi

# Calling functions
DISPLAYLOGO

# OSTEST
OSTEST

Expand All @@ -80,11 +79,12 @@ CREATEKEYFILE
# LOOP DEVICE FUNCTIONS AND HOUSEKEEPING
LOOPBACKTEST
DRAGONFLYHOUSEKEEPING
# FREEBSDHOUSEKEEPING - COMMING SOON
FREEBSDHOUSEKEEPING

# SAFETY CHECKS
ASKUSERVERIFYDIALOG
ASKUSERVERIFYCONSOLE

LOOPBACKMETHOD
DEVICEEXISTS
DONTSHREDIFLOOPBACK
Expand All @@ -106,7 +106,6 @@ LUKSOPEN
GELI
GELIKEYFILE
GELIOPEN
sleep 20
# CGD PROCESS COMMING SOON
# CGD
# CGDKEYFILE
Expand All @@ -121,8 +120,8 @@ sleep 20
CREATEANDMOUNTFS

# END PROGRAM
#DISPLAYLOGO
#echo The data below can also be found in /keys/$name.information
#DISPLAYSUMMARY
#WRITEINFORMATIONFILE
#exit 0
DISPLAYLOGO
echo The data below can also be found in /keys/$name.information
DISPLAYSUMMARY
WRITEINFORMATIONFILE
exit 0
25 changes: 13 additions & 12 deletions LUKSUS.functions
Expand Up @@ -16,19 +16,19 @@ OSTEST()
# OS Checking
if [[ $UNAME == Linux ]]
then
ENCRYPTION=LUKS
# ENCRYPTION=LUKS
echo On $UNAME, defaulting to $ENCRYPTION
elif [[ $UNAME == DragonFly ]]
then
ENCRYPTION=LUKS
# ENCRYPTION=LUKS
echo On $UNAME, defaulting to $ENCRYPTION
elif [[ $UNAME = FreeBSD ]]
then
ENCRYPTION=GELI
echo On $UNAME, Encryption set to $ENCRYPTION
else
ENCRYPTION=LUKSUS
echo No idea $UNAME, defaulting to $ENCRYPTION
echo No idea what I am running on $UNAME, defaulting to $ENCRYPTION
fi
}

Expand All @@ -40,7 +40,7 @@ LOOPBACKTEST()
elif [[ $device == *vn* ]]
then
loopbackdevice=true
elif [[ $device = *md* ]]
elif [[ $device == *md* ]]
then
loopbackdevice=true
else
Expand All @@ -50,7 +50,7 @@ LOOPBACKTEST()

DRAGONFLYHOUSEKEEPING()
{
if [ $UNAME == DragonFly ] ;
if [[ $UNAME == DragonFly ]] ;
then
echo We are on DragonFlyBSD here.
# crude way to deal with different binary names
Expand Down Expand Up @@ -96,14 +96,14 @@ fi

LOOPBACKMETHOD()
{
if [[ $loopbackdevice = true ]] && [[ $UNAME = Linux ]]
if [[ $loopbackdevice == true ]] && [[ $UNAME == Linux ]]
then
echo Beginning loopbackmethod on $device
head -c $luksfilesize /dev/zero > $luksfile
# block device housekeeping
losetup -f 1>/dev/null 2>/dev/null
losetup $device $luksfile
elif [[ $loopbackdevice = true ]] && [[ $UNAME = DragonFly ]]
elif [[ $loopbackdevice == true ]] && [[ $UNAME == DragonFly ]]
then
echo DragonFlyBSD - Nice...
echo Beginning loopbackmethod on $device
Expand All @@ -113,7 +113,7 @@ LOOPBACKMETHOD()
# is initializing something on first run. Then it must run again.
vnconfig 1>/dev/null 2>/dev/null
vnconfig $device $luksfile
elif [[ $loopbackdevice = true ]] && [[ $UNAME = FreeBSD ]]
elif [[ $loopbackdevice == true ]] && [[ $UNAME == FreeBSD ]]
then
echo FreeBSD - Nice...
ghead /dev/zero -c $luksfilesize > $luksfile
Expand All @@ -126,7 +126,8 @@ LOOPBACKMETHOD()

DONTSHREDIFLOOPBACK()
{
if [[ $device != *loop* ]] && [[ $device != *vn* ]] && [[ $device != *md* ]]
if [[ $loopbackdevice == false ]] && [[ $UNAME == Linux ]]
# this test makes little sense now that we are in the future # if [[ $device != *loop* ]] && [[ $device != *vn* ]] && [[ $device != *md* ]]
then
echo "Okay we are using $device ..."
echo Shredding ...
Expand All @@ -135,18 +136,18 @@ DONTSHREDIFLOOPBACK()
# Good for paranoid and security minded people
# This takes about 5 hours on a 3TB drive
shred -f -v -n1 $device || gshred -f -v -n1 $device
elif [[ $device = !*vn* ]]
elif [[ $loopbackdevice == false ]] && [[ UNAME == DragonFly ]]
then
echo On DragonFlyBSD. Okay cool.
echo in the middle of the shredding.place
gshred -f -v -n1 $device
elif [[ $device != *md* ]]
elif [[ $loopbackdevice == false ]] && [[ $UNAME == FreeBSD ]]
then
echo On FreeBSD. Okay cool.
echo in the middle of the shredding.place
gshred -f -v -n1 $device
else
echo "$device is a loopback device"
echo "$device is a loopback device. Not shredding, since its no use."
fi
}

Expand Down
4 changes: 2 additions & 2 deletions LUKSUS.variables
@@ -1,6 +1,6 @@
programname=LUKSUS
version=v1.1
date=04.08.2013
version=v1.2
date=05.08.2013
author="Thomas J. Frivold"
time1="$(date +%s.%N)"
# $1, %2, %3, %4 are command line arguments
Expand Down
10 changes: 10 additions & 0 deletions README
Expand Up @@ -327,6 +327,16 @@ A: LUKSUS is maintained in a Github repository.
# NetBSD's CGD and OpenBSDs BIOCTL. This would bump the number of
supported platforms to 5.

# v1.2
# Fixes some regressions

# v1.1
# Adds FreeBSD support

# v1.0
# LUKSUS is stable and mature enough to be called 1.0
# Tested on Linux and DragonFlyBSD

# v1.0RC4 22.07.2013 15:09
# +Removed some extra integrity checks. They were redundant and broke
# Truecrypt support
Expand Down

0 comments on commit 232072e

Please sign in to comment.