From: Renê <re...@re...> - 2010-12-03 03:06:43
|
Hello Folks, I have developed a file system to handle symbolic links over file systems that do not support it. Let me explains better... I am using a cloud/distributed storage software (wuala, to be more specific), which file system do not support symbolic links. This is a issue to me because I use unison to syncronize my files, that, of course, contains symbolic links... so I create NLINKFS (http://sourceforge.net/projects/nlinkfs/) with fuse. Actually NLINKFS just stores symbolic links as regular files that contains where the link points to. Most of fs syscalls (unlink, mkdir, rmdir, etc..) it's just pass through... readlink of course, reads the location pointed by the link on the right (regular) file at the original file system. But the problem is when I execute chmod or chown, fuse uses readlink to get the file that symlink points to and than, execute chmod on the file, changing the attributes of the file, not of the link itself. I tought that was something wrong in my code, but bbfs (from fuse-tutorial) and sshfs has the same behavior. Steps to reproduce: 1) Mount some remote dir with sshfs $ sshfs foo@bar:/home/foo mntdir $ cd mntdir 2) On the mounted dir, create some file: $ touch hello.txt 3) Than, create a symbolic link to the file: $ ln -s hello.txt testlink testlink will have 777 permission attributes. 4) Change the permission of the link: $ chmod 600 testlink 5) Now check with: $ ls -l The symbolic link still have 777 as permissions, but the hello.txt will have 600 permission attributes, which is wrong, execute chmod on the link needs to change the link file, not the file pointed by the link. For while, there is a work around that I can do in my code, not in fuse itself? Cheers; Renê |