disable symlink translation for now

This commit is contained in:
chrislu
2022-07-24 18:24:34 -07:00
parent 3d2bbf96d2
commit 2dc5d4adac
4 changed files with 21 additions and 14 deletions

View File

@@ -125,7 +125,7 @@ func (wfs *WFS) Init(server *fuse.Server) {
wfs.fuseServer = server
}
func (wfs *WFS) maybeReadEntry(inode uint64) (path util.FullPath, fh *FileHandle, entry *filer_pb.Entry, status fuse.Status) {
func (wfs *WFS) maybeReadEntry(inode uint64, followSymLink bool) (path util.FullPath, fh *FileHandle, entry *filer_pb.Entry, targetInode uint64, status fuse.Status) {
path, status = wfs.inodeToPath.GetPath(inode)
if status != fuse.OK {
return
@@ -136,11 +136,14 @@ func (wfs *WFS) maybeReadEntry(inode uint64) (path util.FullPath, fh *FileHandle
if entry != nil && fh.entry.Attributes == nil {
entry.Attributes = &filer_pb.FuseAttributes{}
}
status = fuse.OK
} else {
entry, status = wfs.maybeLoadEntry(path)
}
if status == fuse.OK && entry.FileMode()&os.ModeSymlink != 0 {
targetInode = inode
if status == fuse.OK && followSymLink && entry.FileMode()&os.ModeSymlink != 0 {
if entry != nil && entry.Attributes != nil && entry.Attributes.Inode != 0 {
targetInode = entry.Attributes.Inode
}
target := filepath.Join(string(path), "../"+entry.Attributes.SymlinkTarget)
entry, status = wfs.maybeLoadEntry(util.FullPath(target))
}