MD14 / cryptonite

Automatically exported from code.google.com/p/cryptonite
GNU General Public License v2.0
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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,d
mask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,ut
f8,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,d
mask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,ut
f8,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,d
mask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,ut
f8,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).

2. 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 reported on code.google.com by jfre...@googlemail.com on 12 Jun 2012 at 8:14

GoogleCodeExporter commented 8 years ago
Should have also said - this is the stock ICS ROM from Samsung.

Original comment by jfre...@googlemail.com on 12 Jun 2012 at 8:15

GoogleCodeExporter commented 8 years ago
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?

Original comment by jfre...@googlemail.com on 12 Jun 2012 at 1:08

GoogleCodeExporter commented 8 years ago
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:
  * Find out what the correct location on your phone is, and use that in case /sdcard/Android/data/csh.cryptonite fails. What's the location that's flashing up when you select "Use external storage" in the Cryptonite preferences menu?
  * Get the correct external application directory from C. No idea how to do that (see https://developer.android.com/reference/android/content/Context.html#getExternalFilesDir(java.lang.String) for the Java version).
  * Find out what the correct location on your phone is, and use that in case /sdcard/Android/data/csh.cryptonite fails. What's the location that's flashing up when you select "Use external storage" in the Cryptonite preferences menu?
  * Use the TMPDIR environment variable, as does the original truecrypt code. Supposedly there must have been some problem when I first tested it, otherwise I wouldn't have edited the original truecrypt code. Maybe it was a permissions problem.
* Write the external application directory to some string with the Cryptonite 
app and read this string from the truecrypt C code.

Original comment by christoph.schmidthieber@gmail.com on 12 Jun 2012 at 2:35

GoogleCodeExporter commented 8 years ago
The location that flashes up when I select 'Use external storage' is:

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

Original comment by jfre...@googlemail.com on 25 Jun 2012 at 8:18

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

Original comment by christoph.schmidthieber@gmail.com on 25 Jun 2012 at 8:53

GoogleCodeExporter commented 8 years ago
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

Original comment by san...@gmail.com on 31 Aug 2012 at 7:55

GoogleCodeExporter commented 8 years ago
@sanete: do you mean that it happens when you use the Linux version of 
truecrypt?

Original comment by christoph.schmidthieber@gmail.com on 31 Aug 2012 at 8:00

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

Original comment by san...@gmail.com on 2 Sep 2012 at 6:26

GoogleCodeExporter commented 8 years ago
After rebooting, it works now!

Original comment by san...@gmail.com on 2 Sep 2012 at 7:28

GoogleCodeExporter commented 8 years ago
So how can i change default path to your truecrypt TMPDIR to use it on internal 
sdcard? thanks!

Original comment by emlen...@gmail.com on 20 Mar 2013 at 6:42

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
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-var
iable-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 ;) )

Original comment by burnacc0...@gmail.com on 12 Dec 2013 at 9:39

GoogleCodeExporter commented 8 years ago
This issue has moved to https://github.com/neurodroid/cryptonite/issues/31

Original comment by christoph.schmidthieber@gmail.com on 28 Aug 2014 at 3:54