From edf4ef493df31c151b14f14754b96f061d86023c Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Thu, 8 Sep 2016 14:51:21 +0200 Subject: Implement support for luks-encrypted files --- cmount.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cmount.py') diff --git a/cmount.py b/cmount.py index 341b5a0..edbacc3 100755 --- a/cmount.py +++ b/cmount.py @@ -20,6 +20,12 @@ def main(): config_dict = json.load(fp) cstm_error = 'Invalid / nonexistent mapping: {0}'.format(sys.argv[1]) data = config_dict[sys.argv[1]] + if data.get('type') == 'efile': + cstm_error = 'Unable to create loop device' + data['device'] = subprocess.check_output(['/usr/sbin/losetup', + '--find', + '--show', + data['device']]).strip() cstm_error = 'system() error' subprocess.check_call(['/sbin/cryptsetup', 'luksOpen', -- cgit v1.3