summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
authorCraig Chi <craigchi@google.com>2020-08-20 10:40:41 -0700
committerAndrei Vagin <avagin@gmail.com>2020-09-11 13:35:25 -0700
commitaad7e25632ee972bd026c83b3881b2166175b4db (patch)
tree52c917988a7d2a256d650ee31596a017c92ff05e /pkg
parent3c7692e8c5bd21432e8ecab9556722d00f54384a (diff)
Implementing inode.Getlink
kernfs uses inode.Getlink to resolve symlink when look up paths. Updates #3452
Diffstat (limited to 'pkg')
-rw-r--r--pkg/sentry/fsimpl/fuse/fusefs.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/sentry/fsimpl/fuse/fusefs.go b/pkg/sentry/fsimpl/fuse/fusefs.go
index c55ea927a..e1bbb4b52 100644
--- a/pkg/sentry/fsimpl/fuse/fusefs.go
+++ b/pkg/sentry/fsimpl/fuse/fusefs.go
@@ -488,6 +488,12 @@ func (i *inode) newEntry(ctx context.Context, name string, fileType linux.FileMo
return child.VFSDentry(), nil
}
+// Getlink implements Inode.Getlink.
+func (i *inode) Getlink(ctx context.Context, mnt *vfs.Mount) (vfs.VirtualDentry, string, error) {
+ path, err := i.Readlink(ctx, mnt)
+ return vfs.VirtualDentry{}, path, err
+}
+
// Readlink implements kernfs.Inode.Readlink.
func (i *inode) Readlink(ctx context.Context, mnt *vfs.Mount) (string, error) {
if i.Mode().FileType()&linux.S_IFLNK == 0 {