summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/vfs/memxattr/xattr.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-07-12 22:31:07 +0000
committergVisor bot <gvisor-bot@google.com>2021-07-12 22:31:07 +0000
commitcbf3251b8d2ea4b6ab3eff2bd6a4b2804a11706c (patch)
tree24b26c36e631a803a71bffeff8f0658247db0fc2 /pkg/sentry/vfs/memxattr/xattr.go
parentf28c339def09aea90fe60b3abb38215c5e5c8e52 (diff)
parente3fdd1593217894328d5a917bbc356d0a7d145f0 (diff)
Merge release-20210705.0-11-ge3fdd1593 (automated)
Diffstat (limited to 'pkg/sentry/vfs/memxattr/xattr.go')
-rw-r--r--pkg/sentry/vfs/memxattr/xattr.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/pkg/sentry/vfs/memxattr/xattr.go b/pkg/sentry/vfs/memxattr/xattr.go
index efc9c6a5d..f0f82a4d6 100644
--- a/pkg/sentry/vfs/memxattr/xattr.go
+++ b/pkg/sentry/vfs/memxattr/xattr.go
@@ -24,7 +24,6 @@ import (
"gvisor.dev/gvisor/pkg/sentry/kernel/auth"
"gvisor.dev/gvisor/pkg/sentry/vfs"
"gvisor.dev/gvisor/pkg/sync"
- "gvisor.dev/gvisor/pkg/syserror"
)
// SimpleExtendedAttributes implements extended attributes using a map of
@@ -55,7 +54,7 @@ func (x *SimpleExtendedAttributes) GetXattr(creds *auth.Credentials, mode linux.
// Check that the size of the buffer provided in getxattr(2) is large enough
// to contain the value.
if opts.Size != 0 && uint64(len(value)) > opts.Size {
- return "", syserror.ERANGE
+ return "", linuxerr.ERANGE
}
return value, nil
}
@@ -77,7 +76,7 @@ func (x *SimpleExtendedAttributes) SetXattr(creds *auth.Credentials, mode linux.
_, ok := x.xattrs[opts.Name]
if ok && opts.Flags&linux.XATTR_CREATE != 0 {
- return syserror.EEXIST
+ return linuxerr.EEXIST
}
if !ok && opts.Flags&linux.XATTR_REPLACE != 0 {
return linuxerr.ENODATA
@@ -107,7 +106,7 @@ func (x *SimpleExtendedAttributes) ListXattr(creds *auth.Credentials, size uint6
}
x.mu.RUnlock()
if size != 0 && uint64(listSize) > size {
- return nil, syserror.ERANGE
+ return nil, linuxerr.ERANGE
}
return names, nil
}