aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-07-24 15:11:24 -0700
committerchrislu <chris.lu@gmail.com>2022-07-24 15:11:24 -0700
commit7386cf6a06f4e879f3598895d66e65d538eac26e (patch)
treebf781e2592ccb1420fa47aa3af176efc56a3b6f6 /weed/mount/weedfs.go
parent40089b6753b78f45abd213a0da7750541edd6b24 (diff)
downloadseaweedfs-7386cf6a06f4e879f3598895d66e65d538eac26e.tar.xz
seaweedfs-7386cf6a06f4e879f3598895d66e65d538eac26e.zip
mount: resolve symlink
Diffstat (limited to 'weed/mount/weedfs.go')
-rw-r--r--weed/mount/weedfs.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.go
index 584174202..697afcbca 100644
--- a/weed/mount/weedfs.go
+++ b/weed/mount/weedfs.go
@@ -139,6 +139,10 @@ func (wfs *WFS) maybeReadEntry(inode uint64) (path util.FullPath, fh *FileHandle
return path, fh, entry, fuse.OK
}
entry, status = wfs.maybeLoadEntry(path)
+ if status == fuse.OK && entry.FileMode()&os.ModeSymlink != 0 {
+ target := filepath.Join(string(path), "../"+entry.Attributes.SymlinkTarget)
+ entry, status = wfs.maybeLoadEntry(util.FullPath(target))
+ }
return
}