diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-01-28 20:40:59 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-01-28 20:40:59 +0000 |
commit | 3e42041191403bc415a8d6798137d7ea5a446329 (patch) | |
tree | 6b9548f90defce102432b0936f315c5bc61e684c /pkg/sentry/vfs/vfs.go | |
parent | d291bc819943847b5281e43c0d600722c65d5f0c (diff) | |
parent | d8c330254a7df21cb5edac3440b62a512fcc8d2d (diff) |
Merge release-20210125.0-15-gd8c330254 (automated)
Diffstat (limited to 'pkg/sentry/vfs/vfs.go')
-rw-r--r-- | pkg/sentry/vfs/vfs.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/sentry/vfs/vfs.go b/pkg/sentry/vfs/vfs.go index 6fd1bb0b2..0aff2dd92 100644 --- a/pkg/sentry/vfs/vfs.go +++ b/pkg/sentry/vfs/vfs.go @@ -425,6 +425,18 @@ func (vfs *VirtualFilesystem) OpenAt(ctx context.Context, creds *auth.Credential rp.mustBeDir = true rp.mustBeDirOrig = true } + if opts.Flags&linux.O_PATH != 0 { + vd, err := vfs.GetDentryAt(ctx, creds, pop, &GetDentryOptions{}) + if err != nil { + return nil, err + } + fd := &opathFD{} + if err := fd.vfsfd.Init(fd, opts.Flags, vd.Mount(), vd.Dentry(), &FileDescriptionOptions{}); err != nil { + return nil, err + } + vd.DecRef(ctx) + return &fd.vfsfd, err + } for { fd, err := rp.mount.fs.impl.OpenAt(ctx, rp, *opts) if err == nil { |