From 56584aef694004ad0df87edb4942623e006e9e0c Mon Sep 17 00:00:00 2001 From: age Date: Sun, 12 Aug 2007 09:35:26 +0000 Subject: [PATCH] * filesystem determination works with encrypted containers --- src/cryptobox/core/container.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cryptobox/core/container.py b/src/cryptobox/core/container.py index 1ac30fa..7c6d434 100644 --- a/src/cryptobox/core/container.py +++ b/src/cryptobox/core/container.py @@ -453,18 +453,26 @@ class CryptoBoxContainer: def __get_fs_type(self): "returns the filesystem used on a container" - #TODO: with a luks volume use the mapping instead of the device + ## should we handle device mapping or plain device + if self.__is_luks_partition() and self.name: + container = os.path.join(self.__dmDir, self.name) + ## can't determine fs while encrypted + if not self.is_mounted(): + return "unavailable" + else: + container = self.device proc = subprocess.Popen( shell = False, stdout = subprocess.PIPE, stderr = subprocess.PIPE, args = [ self.cbox.prefs["Programs"]["blkid"], "-s","TYPE", - self.device ]) + container ]) (stdout, stderr) = proc.communicate() if proc.returncode == 0: return stdout.split("TYPE=")[1] else: + ## if something goes wrong don't dig deeper self.cbox.log.warn("filesystem determination failed: %s" % \ (stderr.strip(), )) return "undetermined"