diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-04-06 23:37:13 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-04-06 23:37:13 +0000 |
commit | cc6e5e72ef985cfcb53e897239cc111a31733c46 (patch) | |
tree | 807b305cdfe37f74a382595277eb62fde013c96e /pkg/sentry/fsimpl/kernfs/kernfs.go | |
parent | 8896fc29043691bdc617602c59d739c1fcaa4ede (diff) | |
parent | dd98fdd5beb7f02e7c7b3aeb4f07f5d00ffc41e7 (diff) |
Merge release-20200323.0-75-gdd98fdd (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/kernfs/kernfs.go')
-rwxr-xr-x | pkg/sentry/fsimpl/kernfs/kernfs.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/kernfs/kernfs.go b/pkg/sentry/fsimpl/kernfs/kernfs.go index 2cefef020..ad76b9f64 100755 --- a/pkg/sentry/fsimpl/kernfs/kernfs.go +++ b/pkg/sentry/fsimpl/kernfs/kernfs.go @@ -414,7 +414,21 @@ type inodeDynamicLookup interface { } type inodeSymlink interface { - // Readlink resolves the target of a symbolic link. If an inode is not a + // Readlink returns the target of a symbolic link. If an inode is not a // symlink, the implementation should return EINVAL. Readlink(ctx context.Context) (string, error) + + // Getlink returns the target of a symbolic link, as used by path + // resolution: + // + // - If the inode is a "magic link" (a link whose target is most accurately + // represented as a VirtualDentry), Getlink returns (ok VirtualDentry, "", + // nil). A reference is taken on the returned VirtualDentry. + // + // - If the inode is an ordinary symlink, Getlink returns (zero-value + // VirtualDentry, symlink target, nil). + // + // - If the inode is not a symlink, Getlink returns (zero-value + // VirtualDentry, "", EINVAL). + Getlink(ctx context.Context) (vfs.VirtualDentry, string, error) } |