From 983e30c01616b40348735f894d42bbad204f6b99 Mon Sep 17 00:00:00 2001 From: Craig Chi Date: Thu, 20 Aug 2020 10:40:41 -0700 Subject: Implementing inode.Getlink kernfs uses inode.Getlink to resolve symlink when look up paths. Updates #3452 --- pkg/sentry/fsimpl/fuse/fusefs.go | 6 ++++++ 1 file changed, 6 insertions(+) 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 { -- cgit v1.2.3