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 --- cumount.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cumount.py') diff --git a/cumount.py b/cumount.py index ad9f681..16aa2f3 100755 --- a/cumount.py +++ b/cumount.py @@ -25,6 +25,15 @@ def main(): subprocess.check_call(['/sbin/cryptsetup', 'luksClose', data['mapper_name']]) + if data.get('type') == 'efile': + cstm_error = 'Unable to destroy loop device' + loop_device = subprocess.check_output(['/usr/sbin/losetup', + '--associated', + data['device']]) + loop_device = loop_device.split(':')[0] + subprocess.check_call(['/usr/sbin/losetup', + '-d', + loop_device]) except subprocess.CalledProcessError as e: sys.stderr.write('Execution error: {0}\n'.format(e)) sys.stderr.flush() -- cgit v1.3