From bbefb316f40c04e871612be92238b36dfd19f1aa Mon Sep 17 00:00:00 2001 From: frisco <> Date: Sun, 28 Jun 2009 00:53:52 +0000 Subject: [PATCH] Removed unnecessary "--batch-mode" arguments to cryptsetup; fixed sizing issue with config partition (cryptsetup is supposed to ignore "--batch-mode" unless given the "luksFormat" command, but there have been problems with it in the past, for example with "isLuks".) --- staging-v0.3.5/plugins/partition/partition.py | 6 ++++-- staging-v0.3.5/plugins/partition/root_action.py | 3 +++ staging-v0.3.5/src/cryptobox/core/container.py | 15 +++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/staging-v0.3.5/plugins/partition/partition.py b/staging-v0.3.5/plugins/partition/partition.py index 4832e07..766106e 100644 --- a/staging-v0.3.5/plugins/partition/partition.py +++ b/staging-v0.3.5/plugins/partition/partition.py @@ -36,8 +36,10 @@ PARTTYPES = { "windows" : ["0xC", "vfat"], "linux" : ["L", "ext3"]} +##The configuration partition should be greater than the +##MINIMUM_STORAGE_SIZE to avoid problems, given sfdisk's size rounding. CONFIGPARTITION = { - "size" : 5, # size of configuration partition (if necessary) in MB + "size" : 12, ## size of configuration partition (if necessary) in MB "type" : "L", "fs" : "ext2"} @@ -365,7 +367,7 @@ class partition(cryptobox.plugins.base.CryptoBoxPlugin): if int(size) > avail_size: self.hdf["Data.Warning"] = "Plugins.partition.PartitionTooBig" continue - if int(size) < 10: + if int(size) < blockdevice_tools.MINIMUM_STORAGE_SIZE: self.hdf["Data.Warning"] = "Plugins.partition.PartitionTooSmall" continue if not part_type in PARTTYPES.keys(): diff --git a/staging-v0.3.5/plugins/partition/root_action.py b/staging-v0.3.5/plugins/partition/root_action.py index fd61868..066d61d 100755 --- a/staging-v0.3.5/plugins/partition/root_action.py +++ b/staging-v0.3.5/plugins/partition/root_action.py @@ -58,6 +58,9 @@ def __rereadPartitions(device): return proc.returncode == 0 def __formatPartition(device, type): + ##TODO: This function is *probably* no longer used, since + ##the user "cryptobox" is now a member of group "disk", but + ##now (right before a release) is not the best time to remove it. import time, threading result = True def formatting(): diff --git a/staging-v0.3.5/src/cryptobox/core/container.py b/staging-v0.3.5/src/cryptobox/core/container.py index e0c3f78..2d17d6e 100644 --- a/staging-v0.3.5/src/cryptobox/core/container.py +++ b/staging-v0.3.5/src/cryptobox/core/container.py @@ -284,8 +284,7 @@ class CryptoBoxContainer: self.cbox.prefs["Programs"]["CryptoBoxRootActions"], "program", "cryptsetup", "luksAddKey", - self.get_device(), - "--batch-mode"]) + self.get_device()]) proc.stdin.write("%s\n%s" % (oldpw, newpw)) (output, errout) = proc.communicate() if proc.returncode != 0: @@ -311,8 +310,7 @@ class CryptoBoxContainer: "program", "cryptsetup", "luksDelKey", self.get_device(), - "%d" % (keyslot, ), - "--batch-mode"]) + "%d" % (keyslot, )]) proc.wait() if proc.returncode != 0: error_msg = "Could not remove the old luks key: %s" % (proc.stderr.read().strip(), ) @@ -454,8 +452,7 @@ class CryptoBoxContainer: "program", "cryptsetup", "luksOpen", self.get_device(), - self.name, - "--batch-mode"]) + self.name]) proc.stdin.write(password) (output, errout) = proc.communicate() if proc.returncode != 0: @@ -536,8 +533,7 @@ class CryptoBoxContainer: self.cbox.prefs["Programs"]["CryptoBoxRootActions"], "program", "cryptsetup", "luksClose", - self.name, - "--batch-mode"]) + self.name]) proc.wait() if proc.returncode != 0: err_msg = "Could not remove the luks mapping: %s" % (proc.stderr.read().strip(), ) @@ -705,8 +701,7 @@ class CryptoBoxContainer: "program", "cryptsetup", "luksOpen", self.get_device(), - self.name, - "--batch-mode"]) + self.name]) proc.stdin.write(password) (output, errout) = proc.communicate() if proc.returncode != 0: