diff options
author | Ridwan Sharif <ridwanmsharif@google.com> | 2020-07-27 14:42:31 -0400 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2020-09-11 13:35:25 -0700 |
commit | eccdd440899113c229f4abea53c03364d7f9875c (patch) | |
tree | a3187c9512e9e7c89d121a7103e6c54a67a213b3 /pkg/sentry/fsimpl/fuse/file.go | |
parent | a94377620401aee2b3e37d16f90054f7ddc756da (diff) |
fuse: Implement IterDirents for directory file description
Fixes #3255.
This change adds support for IterDirents. You can now use `ls` in
the FUSE sandbox.
Co-authored-by: Craig Chi <craigchi@google.com>
Diffstat (limited to 'pkg/sentry/fsimpl/fuse/file.go')
-rw-r--r-- | pkg/sentry/fsimpl/fuse/file.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/fuse/file.go b/pkg/sentry/fsimpl/fuse/file.go index 01d20caf6..186ec2362 100644 --- a/pkg/sentry/fsimpl/fuse/file.go +++ b/pkg/sentry/fsimpl/fuse/file.go @@ -42,6 +42,9 @@ type fileDescription struct { // OpenFlag is the flag returned by open. OpenFlag uint32 + + // off is the file offset. + off int64 } func (fd *fileDescription) dentry() *kernfs.Dentry { @@ -119,5 +122,6 @@ func (fd *fileDescription) Stat(ctx context.Context, opts vfs.StatOptions) (linu // SetStat implements FileDescriptionImpl.SetStat. func (fd *fileDescription) SetStat(ctx context.Context, opts vfs.SetStatOptions) error { - return nil + creds := auth.CredentialsFromContext(ctx) + return fd.inode().SetStat(ctx, fd.inode().fs.VFSFilesystem(), creds, opts) } |