neurodroid / cryptonite

EncFS and TrueCrypt on Android
GNU General Public License v2.0
203 stars 49 forks source link

Mounting a Truecrypt volume fails with 'Failed to create a file or directory in a temporary directory.' #31

Open neurodroid opened 10 years ago

neurodroid commented 10 years ago

From jfre...@googlemail.com on June 12, 2012 09:14:56

This is on a Galaxy Note w/ICS and rooted. "/dev/fuse" exists, and "losetup -f" indicates "/dev/block/loop0" is free.

The Note has Android "full disk ecnryption" turned on - which gives an output from 'mount' of:

" rootfs / rootfs ro,relatime 0 0 tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0 devpts /dev/pts devpts rw,relatime,mode=600 0 0 proc /proc proc rw,relatime 0 0 sysfs /sys sysfs rw,relatime 0 0 none /acct cgroup rw,relatime,cpuacct 0 0 tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0 tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0 none /dev/cpuctl cgroup rw,relatime,cpu 0 0 /dev/block/mmcblk0p9 /system ext4 ro,noatime,barrier=1,data=ordered 0 0 /dev/block/mmcblk0p7 /cache ext4 rw,nosuid,nodev,noatime,barrier=1,data=ordered 0 0 /dev/block/mmcblk0p1 /efs ext4 rw,nosuid,nodev,noatime,barrier=1,data=ordered 0 0 /dev/block/mmcblk0p4 /mnt/.lfs j4fs rw,relatime 0 0 /sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0 /dev/block/mmcblk0p12 /preload ext4 ro,nosuid,nodev,noatime,barrier=1,data=ordered 0 0 /dev/block/dm-0 /data ext4 rw,nosuid,nodev,noatime,barrier=1,data=ordered,noauto_da_alloc 0 0 /dev/block/vold/254:1 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime,uid=1000,gid=1015,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro,discard 0 0 tmpfs /mnt/sdcard/external_sd tmpfs rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime,size=0k,mode=755,gid=1000 0 0 tmpfs /mnt/sdcard/usbStorage tmpfs rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime,size=0k,mode=755,gid=1000 0 0 /dev/block/vold/179:9 /mnt/sdcard/external_sd vfat rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime,uid=1000,gid=1023,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0 /dev/block/vold/179:9 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime,uid=1000,gid=1023,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0 tmpfs /mnt/sdcard/external_sd/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0 " What steps will reproduce the problem? 1. Create a test Truecrypt volume, e.g. 'test.tc' on a PC using the default settings, and format it with FAT. Then copy it to the Android device (e.g. in /sdcard).

  1. Attempt to mount it with:

"

mkdir /sdcard/mnt

/data/data/csh.cryptonite/truecrypt /sdcard/test.tc /sdcard/mnt

% Enter password for /sdcard/test.tc: xxxxx Enter keyfile [none]: Protect hidden volume (if any)? (y=Yes/n=No) [No]: Error: Failed to create a file or directory in a temporary directory.

Please make sure that the temporary directory exists, its security permissions allow you to access it, and there is sufficient disk space: /sdcard/Android/data/csh.cryptonite/.truecrypt_aux_mnt256 "

The above was done from a Quicksshd session - hence the full path to truecrytpt being used (when this works I'll probably add it to the shell's path - or script it).

Original issue: http://code.google.com/p/cryptonite/issues/detail?id=31

neurodroid commented 10 years ago

From jfre...@googlemail.com on June 12, 2012 01:15:34

Should have also said - this is the stock ICS ROM from Samsung.

neurodroid commented 10 years ago

From jfre...@googlemail.com on June 12, 2012 06:08:27

If I create the missing directory - the truecrypt command completes sucessfully - and I can mount the container:

" df | grep /sdcard/mnt /mnt/sdcard/mnt 31M 75K 31M 1024 "

I don't know if I did or didn't do something to cause that directory to get created - or whether it's in a different place because of the full disk encryption?

neurodroid commented 10 years ago

From christoph.schmidthieber@gmail.com on June 12, 2012 07:35:39

That's a bug in l.54 of https://code.google.com/p/cryptonite/source/browse/tc/tc-android.patch : The application directory is hardcoded to /sdcard/Android/data/csh.cryptonite, which doesn't seem to be the right place on your phone. Possible fixes:

Status: Accepted
Cc: christoph.schmidthieber@gmail.com

neurodroid commented 10 years ago

From jfre...@googlemail.com on June 25, 2012 01:18:26

The location that flashes up when I select 'Use external storage' is:

/mnt/sdcard/Android/data/csh.cryptonite/cache

neurodroid commented 10 years ago

From christoph.schmidthieber@gmail.com on June 25, 2012 01:53:34

Thanks for reporting, the "cache" subdirectory might explain the bug. Will try to fix this in the near future.

Owner: christoph.schmidthieber@gmail.com
Cc: -christoph.schmidthieber@gmail.com

neurodroid commented 10 years ago

From san...@gmail.com on August 31, 2012 12:55:51

It happens me too with KUbuntu 12.04 in a regular PC. This is the exact error message:

Failed to create a file or directory in a temporary directory.

Please make sure that the temporary directory exists, its security permissions allow you to access it, and there is sufficient disk space: /tmp/.truecrypt_aux_mnt256

neurodroid commented 10 years ago

From christoph.schmidthieber@gmail.com on August 31, 2012 13:00:51

@sanete: do you mean that it happens when you use the Linux version of truecrypt?

neurodroid commented 10 years ago

From san...@gmail.com on September 01, 2012 23:26:52

Yes, but other computers I have with the same operating system work ok. Surely it is some misconfiguration.

neurodroid commented 10 years ago

From san...@gmail.com on September 02, 2012 00:28:02

After rebooting, it works now!

neurodroid commented 10 years ago

From emlen...@gmail.com on March 19, 2013 23:42:08

So how can i change default path to your truecrypt TMPDIR to use it on internal sdcard? thanks!

neurodroid commented 10 years ago

From burnacc0...@gmail.com on December 12, 2013 13:39:47

do I understand correctly that, if the TMPDIR variable is set, it should use that instead of flash card ?

if so, it's just a matter of figuring one's way around the pains of setting variables ( http://stackoverflow.com/questions/3736062/how-to-set-and-use-an-environment-variable-in-android-test )

question to Christoph: why not use /cache as the resting place for TC's temp files?

ps sorry for doublepost. emails being public is not very comfy (Ukraine issues, I have them ;) )