losetup anomaly with OpenSUSE 13.1
TrueCrypt relies on executing commands to setup the Linux device mapper to create encrypted block devices for it, instead of writing a block device driver like they do on Windows. It calls losetup to create a block device backed by a file, and calls dmsetup to create a block device (backed by the loopback device) that transparently decrypts sectors from the backing block device. There are APIs for both of these operations, but the TrueCrypt developers decided to make sudo invocations to execute these commands, instead.
The error presented is "Failed to set up a loop device: /home/kmarek/Desktop/test.img". I then created a wrapper around losetup to log it's arguments and output, and CipherShed passes a very strange argument list:
This is where error is introduced into the process of opening a container file for both creation of new containers, and mounting of existing containers.
Upon further investigation, the loopback devices didn't exist. Loading the loop kernel module made them appear, but TrueCrypt still doesn't check that they exist and form strange filenames if they don't.
Yet another issue related to this is that if /dev/loop0 already setup, TrueCrypt attempts to re-setup the same device before giving up on I/O error, and unallocating the device.