I was thinking about file hiding in ext3 and thought about this method. I want know whether this will work or not.
1. creat an immutable file (/usr/share/exthide/file1.txt)* with content "Tool to hide files"
2. Now creat an symbolic link (exthide.tmp) to (/usr/share/exthide/file1.txt)
3. Now get file that needs to be hidden from user. (/home/laks/userfile.txt)
4. Get user files (/home/laks/userfile.txt) inode,assume it is small-sized file( that if i_block !=0 , then exit)* copy block number at i_block* to i_block and i_size to i_block
5. Now Get exthide.tmp's (symbolic link) i_block value and assign it to i_block* of /home/laks/userfile.txt
** and assign exthide.tmp i_size and i_mode to /home/laks/userfile.txt inode's size and mode.
* ( or should i leave /home/laks/userfile.txt inode's i_size to its original value ?)
6. Now move to /home/laks/userfile.txt* 's directory (ie /home/laks) and change this userfile.txt file type as 7 and write this parent inode.
Thus the file /home/laks/userfile.txt content is hidden now,Since* /home/laks/userfile.txt file type is set as symbolic link and points to (/usr/share/exthide/file1.txt).
If user wants to view hidden file , then again copy back blocks number from i_block to i_block and set file type as regular in inode and pareant inode.
Do you think , this method will work ? or It has serious issues ?
Ext3-users mailing list