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".)
This commit is contained in:
frisco 2009-06-28 00:53:52 +00:00
parent cccc883b49
commit bbefb316f4
3 changed files with 12 additions and 12 deletions

View file

@ -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():

View file

@ -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():

View file

@ -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: