Browse Source

* filesystem determination works with encrypted containers

master
age 15 years ago
parent
commit
56584aef69
  1. 12
      src/cryptobox/core/container.py

12
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"

Loading…
Cancel
Save