neurodroid / cryptonite

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

TrueCrypt sets wrong permissions on FAT32-formatted SD card #32

Closed neurodroid closed 10 years ago

neurodroid commented 10 years ago

From tonynguy...@gmail.com on June 24, 2012 05:08:59

What steps will reproduce the problem? 1. Create a TrueCrypt container volume called myvol.tc on Windows. Mount it and move a text file to the mounted drive. Copy it to /mnt/sdcard/encrypt/myvol.tc on the phone

  1. Run this script to mount a TrueCrypt volume su export tcvolume="/mnt/sdcard/encrypt/myvol.tc" export tcmount="/mnt/sdcard/mnt/mydrive" /data/data/csh.cryptonite/truecrypt -t -k "" --protect-hidden=no -p password $tcvolume $tcmount
  2. The volume mounted successfully at /mnt/sdcard/mnt/mydrive. What is the expected output? What do you see instead? Browse using Root Browser of ROM Toolbox and I can see the text file. However, when I browse using ESExplorer or other apps, the mounted folder is empty. What version of the product are you using? On what operating system? Cryptonite 0.6.12 Android 4.0.4, AOKP ROM Build 39 on Nexus S GSM

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

neurodroid commented 10 years ago

From christoph.schmidthieber@gmail.com on June 24, 2012 02:36:29

Supposedly that's a permission problem? From a root terminal, what's the output of

ls -l -a /mnt/sdcard/mnt/mydrive

after mounting with truecrypt?

neurodroid commented 10 years ago

From tonynguy...@gmail.com on June 24, 2012 07:59:50

-rwx------ root root 1022 2012-06-23 22:15 sample.txt

Here's what I see with the permissions for /mnt/sdcard/mnt/mydrive Before running truecrypt mounting script Permissions: ---rwxr-x Owner: 1000 - system Group: 1015 - sdcard_rw

After mounted Permissions: rwx------ Owner: 0 - root Group: 0 - root

I tried to change permissions and owner using Root Browser or chmod, chown commands, all failed.

neurodroid commented 10 years ago

From tonynguy...@gmail.com on June 24, 2012 20:10:08

Ok, it seems the internal SDCard is formatted with FAT32, so changing permissions/owners are not allowed/supported. I'll keep researching and see if I can mount the SDCard differently. Not a defect/bug of Cryptonite, you can close this Issue.

Thanks!

neurodroid commented 10 years ago

From christoph.schmidthieber@gmail.com on June 25, 2012 01:43:55

Thanks for reporting. Not entirely sure this is a FAT32 issue though. Might be a problem with the TrueCrypt code for Android.

Summary: TrueCrypt sets wrong permissions on FAT32-formatted SD card
Status: Done
Owner: christoph.schmidthieber@gmail.com

neurodroid commented 10 years ago

From pka...@acrobits.cz on July 11, 2012 17:15:49

Try mounting the TC volume using: truecrypt --fs-options="uid=1000,gid=1000,umask=0002" volume.tc /sdcard/tc.

neurodroid commented 10 years ago

From tonynguy...@gmail.com on July 13, 2012 15:13:39

You sir are a genius! Adding the --fs-options worked perfectly. Thank you!!!

neurodroid commented 10 years ago

From christoph.schmidthieber@gmail.com on July 14, 2012 09:59:50

@pkalny: Thanks for reporting this fix. I've added it to the FAQ.

Status: FixVerified

neurodroid commented 10 years ago

From tonynguy...@gmail.com on July 16, 2012 16:10:05

Actually, should set gid=1015 (which is the sdcard_rw group) so files can be moved/copied to the mount point using file managers other than root explorer. At least, that's how it is on my Nexus S.