diff options
| author | Simeon Simeonov | 2016-09-08 14:51:21 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2016-09-08 14:51:21 +0200 |
| commit | edf4ef493df31c151b14f14754b96f061d86023c (patch) | |
| tree | 1bf9a62968a75bfd6ca4414ce1879f9534902007 /cmount.py | |
| parent | a3cb3662a8b15efb3e6a7381cb376a0ca3f095a0 (diff) | |
Implement support for luks-encrypted files
Diffstat (limited to 'cmount.py')
| -rwxr-xr-x | cmount.py | 6 |
1 files changed, 6 insertions, 0 deletions
| @@ -20,6 +20,12 @@ def main(): | |||
| 20 | config_dict = json.load(fp) | 20 | config_dict = json.load(fp) |
| 21 | cstm_error = 'Invalid / nonexistent mapping: {0}'.format(sys.argv[1]) | 21 | cstm_error = 'Invalid / nonexistent mapping: {0}'.format(sys.argv[1]) |
| 22 | data = config_dict[sys.argv[1]] | 22 | data = config_dict[sys.argv[1]] |
| 23 | if data.get('type') == 'efile': | ||
| 24 | cstm_error = 'Unable to create loop device' | ||
| 25 | data['device'] = subprocess.check_output(['/usr/sbin/losetup', | ||
| 26 | '--find', | ||
| 27 | '--show', | ||
| 28 | data['device']]).strip() | ||
| 23 | cstm_error = 'system() error' | 29 | cstm_error = 'system() error' |
| 24 | subprocess.check_call(['/sbin/cryptsetup', | 30 | subprocess.check_call(['/sbin/cryptsetup', |
| 25 | 'luksOpen', | 31 | 'luksOpen', |
