Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix storage-chown-by-maps doesnt handle -EOVERFLOW on lgetxattr [Closes #1183] #1190

Merged
merged 1 commit into from Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/chown_unix.go
Expand Up @@ -84,7 +84,7 @@ func (c *platformChowner) LChown(path string, info os.FileInfo, toHost, toContai
}
if uid != int(st.Uid) || gid != int(st.Gid) {
cap, err := system.Lgetxattr(path, "security.capability")
if err != nil && !errors.Is(err, system.EOPNOTSUPP) && err != system.ErrNotSupportedPlatform {
if err != nil && !errors.Is(err, system.EOPNOTSUPP) && !errors.Is(err, system.EOVERFLOW) && err != system.ErrNotSupportedPlatform {
return fmt.Errorf("%s: %v", os.Args[0], err)
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/system/xattrs_linux.go
Expand Up @@ -13,6 +13,9 @@ const (

// Operation not supported
EOPNOTSUPP unix.Errno = unix.EOPNOTSUPP

// Value is too small or too large for maximum size allowed
EOVERFLOW unix.Errno = unix.EOVERFLOW
)

// Lgetxattr retrieves the value of the extended attribute identified by attr
Expand Down
3 changes: 3 additions & 0 deletions pkg/system/xattrs_unsupported.go
Expand Up @@ -10,6 +10,9 @@ const (

// Operation not supported
EOPNOTSUPP syscall.Errno = syscall.Errno(0)

// Value is too small or too large for maximum size allowed
EOVERFLOW syscall.Errno = syscall.Errno(0)
)

// Lgetxattr is not supported on platforms other than linux.
Expand Down