{"action":"closed","issue":{"url":"https://api.github.com/repos/s3fs-fuse/s3fs-fuse/issues/166","labels_url":"https://api.github.com/repos/s3fs-fuse/s3fs-fuse/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/s3fs-fuse/s3fs-fuse/issues/166/comments","events_url":"https://api.github.com/repos/s3fs-fuse/s3fs-fuse/issues/166/events","html_url":"https://github.com/s3fs-fuse/s3fs-fuse/issues/166","id":67612534,"number":166,"title":"s3fs-fuse with ecryptfs?","user":{"login":"stevenshiau","id":2124129,"avatar_url":"https://avatars.githubusercontent.com/u/2124129?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenshiau","html_url":"https://github.com/stevenshiau","followers_url":"https://api.github.com/users/stevenshiau/followers","following_url":"https://api.github.com/users/stevenshiau/following{/other_user}","gists_url":"https://api.github.com/users/stevenshiau/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenshiau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenshiau/subscriptions","organizations_url":"https://api.github.com/users/stevenshiau/orgs","repos_url":"https://api.github.com/users/stevenshiau/repos","events_url":"https://api.github.com/users/stevenshiau/events{/privacy}","received_events_url":"https://api.github.com/users/stevenshiau/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2015-04-10T14:49:41Z","updated_at":"2015-06-20T02:50:21Z","closed_at":"2015-06-20T02:50:21Z","body":"Dear maintainer,\r\nI encountered an issue when using ecryptfs with s3fs. Here is how the issue could be reproduced. First put the password file in /tmp/p.txt, and its content is like:\r\n```\r\npassphrase_passwd=mypasswd\r\n```\r\nThe script \"s3fs-ecryptfs.sh\" for all the steps:\r\n```\r\n#!/bin/bash\r\ns3fs steven-ocs /home/partimag/\r\nrm -rf /home/partimag/test-s3 /tmp/ecryptfs_mnt\r\nmkdir /home/partimag/test-s3 /tmp/ecryptfs_mnt\r\nmount -t ecryptfs /home/partimag/test-s3 /tmp/ecryptfs_mnt -o ecryptfs_cipher=aes,ecryptfs_key_bytes=16,no_sig_cache,ecryptfs_enable_filename_crypto=n,ecryptfs_passthrough,key=passphrase:passphrase_passwd_file=/tmp/p.txt\r\necho \"It is OK\" > /tmp/ecryptfs_mnt/ok.txt\r\nmd5sum /tmp/ecryptfs_mnt/ok.txt \r\numount /tmp/ecryptfs_mnt\r\nmount -t ecryptfs /home/partimag/test-s3 /tmp/ecryptfs_mnt -o ecryptfs_cipher=aes,ecryptfs_key_bytes=16,no_sig_cache,ecryptfs_enable_filename_crypto=n,ecryptfs_passthrough,key=passphrase:passphrase_passwd_file=/tmp/p.txt\r\nmd5sum /tmp/ecryptfs_mnt/ok.txt \r\numount /tmp/ecryptfs_mnt\r\nmd5sum /home/partimag/test-s3/ok.txt \r\numount /home/partimag/\r\n```\r\nThe results for the above script:\r\n```\r\nroot@vivid:~# ./s3fs-ecryptfs.sh \r\nAttempting to mount with the following options:\r\n  ecryptfs_unlink_sigs\r\n  ecryptfs_passthrough\r\n  ecryptfs_key_bytes=16\r\n  ecryptfs_cipher=aes\r\n  ecryptfs_sig=49138d03ae6831ac\r\nMounted eCryptfs\r\nf313be4f2ce0aa98c9412964e7f0b86e  /tmp/ecryptfs_mnt/ok.txt\r\nAttempting to mount with the following options:\r\n  ecryptfs_unlink_sigs\r\n  ecryptfs_passthrough\r\n  ecryptfs_key_bytes=16\r\n  ecryptfs_cipher=aes\r\n  ecryptfs_sig=49138d03ae6831ac\r\nMounted eCryptfs\r\n853a955ca26b15106dc3a32e4098ebaf  /tmp/ecryptfs_mnt/ok.txt\r\n853a955ca26b15106dc3a32e4098ebaf  /home/partimag/test-s3/ok.txt\r\n```\r\nAs you can see, the md5sum of \"/tmp/ecryptfs_mnt/ok.txt\" in the 2nd mounting is different from the 1st one, and it's the same with encrypted file \"/home/partimag/test-s3/ok.txt\". Therefore you can see ecryptfs failed in decryption.\r\nOn the other hand, I tried the nearly same steps, and the only difference is to mount  a local partition instead of S3 resource. Here the script \"local-ecryptfs.sh\" is:\r\n```\r\n#!/bin/bash\r\nmount /dev/sdc1 /home/partimag/\r\nrm -rf /home/partimag/test-s3 /tmp/ecryptfs_mnt\r\nmkdir /home/partimag/test-s3 /tmp/ecryptfs_mnt\r\nmount -t ecryptfs /home/partimag/test-s3 /tmp/ecryptfs_mnt -o ecryptfs_cipher=aes,ecryptfs_key_bytes=16,no_sig_cache,ecryptfs_enable_filename_crypto=n,ecryptfs_passthrough,key=passphrase:passphrase_passwd_file=/tmp/p.txt\r\necho \"It is OK\" > /tmp/ecryptfs_mnt/ok.txt\r\nmd5sum /tmp/ecryptfs_mnt/ok.txt \r\numount /tmp/ecryptfs_mnt\r\nmount -t ecryptfs /home/partimag/test-s3 /tmp/ecryptfs_mnt -o ecryptfs_cipher=aes,ecryptfs_key_bytes=16,no_sig_cache,ecryptfs_enable_filename_crypto=n,ecryptfs_passthrough,key=passphrase:passphrase_passwd_file=/tmp/p.txt\r\nmd5sum /tmp/ecryptfs_mnt/ok.txt \r\numount /tmp/ecryptfs_mnt\r\nmd5sum /home/partimag/test-s3/ok.txt \r\numount /home/partimag/\r\n```\r\nAs you can see, the only difference is in the 1st line.\r\nNow the results for the script \"local-ecryptfs.sh\":\r\n```\r\nroot@vivid:~# ./local-ecryptfs.sh \r\nAttempting to mount with the following options:\r\n  ecryptfs_unlink_sigs\r\n  ecryptfs_passthrough\r\n  ecryptfs_key_bytes=16\r\n  ecryptfs_cipher=aes\r\n  ecryptfs_sig=49138d03ae6831ac\r\nMounted eCryptfs\r\nf313be4f2ce0aa98c9412964e7f0b86e  /tmp/ecryptfs_mnt/ok.txt\r\nAttempting to mount with the following options:\r\n  ecryptfs_unlink_sigs\r\n  ecryptfs_passthrough\r\n  ecryptfs_key_bytes=16\r\n  ecryptfs_cipher=aes\r\n  ecryptfs_sig=49138d03ae6831ac\r\nMounted eCryptfs\r\nf313be4f2ce0aa98c9412964e7f0b86e  /tmp/ecryptfs_mnt/ok.txt\r\n81543ce01876e7e2fdc17228e731a4ba  /home/partimag/test-s3/ok.txt\r\n```\r\nAs you can see, the md5sum of \"/tmp/ecryptfs_mnt/ok.txt\" in the 2nd mounting is the _same_ with the 1st one. This makes sense. Therefore you can see ecryptfs worked in decryption.\r\nAny thought? Did I miss something? Or by nature the 2 file systems conflict with each other?\r\nThank you very much.\r\n\r\nSteven."}}