diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-01-16 21:04:22 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-01-16 21:04:22 +0000 |
commit | 47e62a0e3dff672ea69e70ec9ee057c77f72803e (patch) | |
tree | 8d2b88c28274499eb932c2d9131385890af15601 /pkg/sentry/fs/copy_up.go | |
parent | 04d906d01293b63764895be93e50af1d65adb8ed (diff) | |
parent | 07f258497932e53f4651b80a086117ffda843fe3 (diff) |
Merge release-20200115.0-9-g07f2584 (automated)
Diffstat (limited to 'pkg/sentry/fs/copy_up.go')
-rw-r--r-- | pkg/sentry/fs/copy_up.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/sentry/fs/copy_up.go b/pkg/sentry/fs/copy_up.go index 734177e90..e03e3e417 100644 --- a/pkg/sentry/fs/copy_up.go +++ b/pkg/sentry/fs/copy_up.go @@ -18,6 +18,7 @@ import ( "fmt" "io" + "gvisor.dev/gvisor/pkg/abi/linux" "gvisor.dev/gvisor/pkg/log" "gvisor.dev/gvisor/pkg/sentry/context" "gvisor.dev/gvisor/pkg/sentry/memmap" @@ -395,12 +396,12 @@ func copyContentsLocked(ctx context.Context, upper *Inode, lower *Inode, size in // Size and permissions are set on upper when the file content is copied // and when the file is created respectively. func copyAttributesLocked(ctx context.Context, upper *Inode, lower *Inode) error { - // Extract attributes fro the lower filesystem. + // Extract attributes from the lower filesystem. lowerAttr, err := lower.UnstableAttr(ctx) if err != nil { return err } - lowerXattr, err := lower.Listxattr() + lowerXattr, err := lower.ListXattr(ctx) if err != nil && err != syserror.EOPNOTSUPP { return err } @@ -421,11 +422,11 @@ func copyAttributesLocked(ctx context.Context, upper *Inode, lower *Inode) error if isXattrOverlay(name) { continue } - value, err := lower.Getxattr(name) + value, err := lower.GetXattr(ctx, name, linux.XATTR_SIZE_MAX) if err != nil { return err } - if err := upper.InodeOperations.Setxattr(upper, name, value); err != nil { + if err := upper.InodeOperations.SetXattr(ctx, upper, name, value, 0 /* flags */); err != nil { return err } } |