Filename Encryption Option Can Keep Two Files Which Have The Same Inode
I have to resurrect this bug that was reported before (Link: https:/
That bug report is very clear, so I don't need to talk that too much. One trouble I have encountered goes like this:
1) The first time I mount <raw> on <secure>:
I copy a non-zero-length file whose name is <can_you_see> to <secure> directory with "Filename Encryption" enabled and then unmount <secure>.
2) The second time I mount <raw> on <secure>:
I disable "Filename Encryption" and create a file named <can_you_see> without any content. Then I unmount again.
3) The third time I mount <raw> on <secure>:
I enable "Filename Encryption" and I execute $ls -i secure/ to list the inode number of each file. It display like below
"65587 can_you_see 65587 can_you_see". If you list the length information of each file, you will find both files have zero-length. That means during the second time mount the file I created can overwrite the existing file and cause data damaged !!!
That was not what I did to eCryptfs intentionally. It cannot be ignored. It has to be fixed, I think.
What do you say about this issue? Any comments are welcome.